StealthBot.net: Block Execute - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Block Execute

#1 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted November 11, 2009 - 07:07 PM

Block Execute Script

Author: Ribose
Version: v2.1.0
Description: Allows you to execute a block of script code in a controlled environment. This script is made for developers.
If you do not understand this script or one of its features, this script or feature is probably not for you.

Commands:
None

Settings:
Several settings are stored for this script, all of which you can access and change via the menu system on the Block Execute form.

How to use:
Go to Scripting > BlockExec > Show Block Execute Window to begin using the script.

Posted Image
Here's the window, with the parts labeled.
Code to execute box:
Here you can place any script code you'd like to test and it will be executed in the language chosen. In this example, the VBScript code below is being executed:
Call ThisIsAFunction()

Function ThisIsAFunction()
    Dim User
    Dbg "function start"
    If IsOnline Then
        For Each User In Channel.Users
            Dbg ResultToString(User) & ": " & User.Name
        Next
    End If
    Dbg "function end"
End Function
(the two functions Dbg and ResultToString will be explained later)
As you can see in the StealthBot window, the list of users in the channel is being displayed.

Execute and escape buttons:
Press the execute button (or use the hotkeys F5 or Control+Enter) to execute the code above, or the hide button (hotkey Escape) to close the form.

Execution and error information area:
Information is displayed here about the current executing code and errors. The current script module and language is in white. The execution time (if this form has executed code before) is in green, and the last error (if one occurred during the last execution) is in red.

Watch exp​ressions box:
This list can be used to "watch", or periodically evaluate, exp​ressions using the same script control settings as the code. Use the "Add" button to add a line, "Evaluate now!" to evaluate the selected exp​ressions, and "Remove" to remove the selected exp​ressions. The exp​ressions will be evaluated on a timer according to the Watch Exp​ressions Settings > Update Speed setting. Warning: Try not to put exp​ressions in this box that cause the bot to repeatedly do something, like AddQ("hi") since the exp​ressions will be continually evaluated, and depending on the update speed and nature of the function may flood you out (or fill your queue).

Settings menus:
The menus here can be used to change the settings of this script.
Execute Under Script Module menu:
Posted Image
This menu lets you choose which script control and module to execute in the context of. The global script control is in the context of the result of SSC.GetScriptControl(), the script control that the bot uses, and the isolated script control is in the context of a script control created by the script which has no modules and is completely separate from the bot's script control. The modules of each of the scripts you have loaded (including those with a setting of Public=False) are loaded into this menu and you can execute the code in the context of any of them (with private variables, etc, available to you). The Module field of the information area will be updated with the format "Script control / module".

Isolated Script Control Settings menu:
Posted Image
This menu lets you control the Isolated Script Control, which you can choose to execute under. These settings will not apply to the bot's script control, but only to the isolated script control.
Isolated Script Control Settings > Reload Control menu:
Will call .Reset on the script control.
Isolated Script Control Settings > Enable UI menu:
Will enable/disable the .AllowUI property on the script control. When disabled, MsgBox() and other script UI functions will cause a permission denied error.
Isolated Script Control Settings > Set Timeout... menu:
Allows you to change the .Timeout property on the script control. When a script executes for longer than this timeout time, a script dialog (Continue or End) will appear.
Isolated Script Control Settings > Set Language menu;
Allows you to choose a script language for the script control. VBScript and JScript are installed default (if they are not this script would not be functioning), and any others that you know you have installed can be entered by going to Input Language and typing the name in the dialog box (such as "Python").

Watch Exp​ressions Settings menu:
Posted Image
This menu lets you control the watch exp​ressions box.
Watch Exp​ressions Settings > Update Speed menu:
Choose the update speed (the length of time between each evaluation) from High, Medium, Low, and Paused.
Watch Exp​ressions Settings > Save Exp​ressions menu:
When this setting is enabled, watch exp​ression box items will be loaded and saved to a file in the script's working directory. This allows you to persist watched items over a script reload.

Errors:
Posted Image
When an error occurs, you see the error message on the right, and two options "Go To" and "Copy".
Go To Error button:
Click this to move the cursor to the line and column where the error occurred.
Copy To Clipboard button:
Click this to copy the error message to the clipboard.
The error message and buttons will hide when a successful execution occurs.

BlockExec Functions:
Two functions are available to any code executed in this dialog (they are actually added to the script control so loaded scripts can use them, though dependency on this script is not recommended):
Dbg(Text)
The Dbg ("debug") function is a shorthand call to AddChat to make debugging of values easier.
Example usages:
'VB '
Dbg "hi"
//JS
Dbg('hi');
#Python
Dbg('hi')


ResultToString(Value)
This function is used for the watch dialog to always return a value that can be put in the list view (a string). It will put quotes around string variables, number signs around date variables, square brackets around arrays (and each item will be shown inside), and curly brackets around other types (it will attempt to show the contents of the variable as best it can).

Changelog:
  • v2.1.0: 2009-12-01 ~Ribose
    • [ADDITION] Added a setting that when enabled (menu: Watch Exp​ressions Settings > Save Exp​ressions), the script will automatically save and load exp​ressions so that they persist over script reloads (thanks FiftyToo).
    • [CHANGE] Changed wording of some menu items.
    • [CHANGE] Changed some comments, object names, variable names, and function names.
    • [FIX] The columns of the Watch Exp​ressions box will now automatically take up 50% each of the box's width when the form is resized, as originally intended.
    • [FIX] When the "Add" watch exp​ression button is pressed, the Watch Exp​ressions box is correctly given focus so that you can immediately edit the new item's value.
    • [FIX] Fixed spelling of "Variant".

  • v2.0.1: 2009-11-11 ~Ribose
    • [FIX] Dialogs are correctly owned by the block execute form and not StealthBot.
    • [FIX] Fixed problems with the "Set Timeout..." dialog.
    • [FIX] Implemented "Go To Error" button.

  • v2.0.0: 2009-09-15 ~Ribose
    • [ADDITION] Watch exp​ressions box allows you to watch items of interest (thanks FiftyToo).
    • [ADDITION] Information area tells about the execution and errors.
    • [ADDITION] Menu system allows you to change settings.
    • [ADDITION] Now able to choose execution "context", or what script control and module the code is executed as (thanks FiftyToo).

  • v1.1.0: 2009-07-21 ~Ribose
    • [CHANGE] F5 (thanks FiftyToo) and Ctrl-Enter execute the code, and Enter creates a new line. Escape still hides the form.
    • [CHANGE] White on blue to white on black code to execute box.
    • [FIX] Focus should return to the code when execution is complete as long as the script control didn't end execution (in an infinite loop, for example).

  • v1.0.0: 2009-07-20 ~Ribose
    • Description: This script will execute the standard VBScript code in the form for debugging purposes. When the form is open (Scripting > BlockExec > Show Block Execute Form) you can use Enter to execute the code you've typed, Escape to close the form, and Control-Enter to go to a new line of code.
    • Created changelog.

Attached File(s)

  • Attached File  bexec.zip (8.57K)
    Number of downloads: 177

~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#2 User is offline   AbsoluteMSTR Icon

  • Newbie
  • PipPip
  • Group: Beta Testers
  • Posts: 88
  • Joined: August-17 09

Posted November 11, 2009 - 08:23 PM

Two Thumbs up, a big improvement from your previous version I recoded to be used for a certain module since it was global only. Is the JavaScript exposed to the ssc?

#3 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted November 11, 2009 - 08:52 PM

What? You can only use JavaScript (JScript) when using the isolated script control, since I can't change the bot's script control language during run time (it would also break the script itself if it worked since it isn't valid JavaScript). I'm not sure what you mean by exposed to the SSC?
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#4 User is offline   AbsoluteMSTR Icon

  • Newbie
  • PipPip
  • Group: Beta Testers
  • Posts: 88
  • Joined: August-17 09

Posted November 11, 2009 - 09:01 PM

Stealthbot Script Control, like objects such as Channel

#5 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted November 11, 2009 - 09:31 PM

Like I said no I can't make the StealthBot SC use JavaScript. Objects such as the channel object are exposed via the SSC (script support class), and the SSC is available to BlockExec.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#6 User is offline   AwaKening Icon

  • how do ya like me now
  • Icon
  • Group: Scripting Moderators
  • Posts: 977
  • Joined: August-20 09

Posted November 11, 2009 - 09:55 PM

Very nice. This will come in handy. No more making test scripts and reloading everytime.

#7 User is offline   seiel Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 23
  • Joined: October-07 09

Posted November 12, 2009 - 04:51 AM

omg, AWESOME script! gonna try it tonight :D thx Ribose!

#8 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted December 02, 2009 - 04:13 AM

New version 2.1.0 with a new feature and many little bug fixes.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#9 User is offline   AbsoluteMSTR Icon

  • Newbie
  • PipPip
  • Group: Beta Testers
  • Posts: 88
  • Joined: August-17 09

Posted January 01, 2010 - 12:00 AM

Request 1:

Save what code was in the textbox so when you reload the scripts, you can open the block exec and resume from where you were original.

Request 2:

Reopen the block exec interface when you reload script if you had it open prior to reloading the script.

Think you can add these Ribose. Also i do recommend this be added to official script list

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users