Two bots in same Hub
Moderator: Moderators
Two bots in same Hub
Hi, a very simple question I am sure but need clarification. Can I use 2 scripts on DC hub? Does it matter if they both have a SUB Main? or do i need to change them. Seems that when I use 2 niether do what they are supposed to and I was thinking this may be the problem. The 2 I am trying to use are Generalbot.script by Gadget and Sickobot from basement tweaked by Koder.
Thanks for any help you may be able to offer anyone.
Thanks for any help you may be able to offer anyone.
A sober mans secret is a drunken mans speech.
thanks I will look further for the problem, unless, what happens is the sickobot picks up a new connection, says you are being disconnected for sharing bad files but still allows the connection. I tried it by renaming a file on my share and connecting to my own hub. Any suggestions?
A sober mans secret is a drunken mans speech.
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
The scripts for a DC Hub have a size limit (roughly 59k), and I accidently found out about it while writing Zeus. Any script larger than this will crash the hub when you try to edit it, and make crazy funny things when you try to run it (trust me, you don't want to try =).
So yes, you can (and if you're crazy like me, you actually will have to) split your scripts in several .script files. Just keep in mind that if one script disconects the user, said user won't be available to the other script anymore, etc etc. Before running 2 or more scripts, make sure they don't step on each other's feet.
The .chm file is indeed an EXCELENT resource, with a very clear tutorial about vbs, and a complete command reference. There is however an updated version of it on microsoft's website (script 56.chm) which doesn't require to have office, and describes the 5.6 scripting engine, instead of the 5.0 engine described in the office documentation. The 5.6 scripting engine is automatically installed along with IE6 (only the engine though, not the vbs reference, which you have to DL seperately)
The vbs command reference is available for download for free, on http://msdn.microsoft.com/downloads/sam ... itedoc.xml
So yes, you can (and if you're crazy like me, you actually will have to) split your scripts in several .script files. Just keep in mind that if one script disconects the user, said user won't be available to the other script anymore, etc etc. Before running 2 or more scripts, make sure they don't step on each other's feet.
The .chm file is indeed an EXCELENT resource, with a very clear tutorial about vbs, and a complete command reference. There is however an updated version of it on microsoft's website (script 56.chm) which doesn't require to have office, and describes the 5.6 scripting engine, instead of the 5.0 engine described in the office documentation. The 5.6 scripting engine is automatically installed along with IE6 (only the engine though, not the vbs reference, which you have to DL seperately)
The vbs command reference is available for download for free, on http://msdn.microsoft.com/downloads/sam ... itedoc.xml
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
Even if your script is over 64 Ko, you can edit it in the editor window to make the changes: BUT before editing, you must select all the script in notepad eg, and paste it in editor window, click stop button, do the changes, and finally reset button.ender wrote:Large scripts will work just fine - my YAMB is 150 kB, and StimBot is over 200... Just don't try to edit them in NMDC Hub.
Ok this method is not simple for edition but i don't know another one.
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
Well, it's not that I'm that found of the blue editor in the NMDC hub, I have just been using it so far because I never found a good editor that would highlight the syntax and all =/ (The editor in office does highlight, but not with .script files for a hub)
Btw, if you know of an editor that does it, let me knoooooow !!! =)
Also, the ability of being able to reset the script right away and see how things go is pretty nifty, but that's about it =p
Now that Ender told me it worked, I've been spending the whole morning pondering if I should just keep everything as is, or settle for a notepad and combine Zeus with ZeusAux1 and ZeusAux2 =p
One of the dictionaries has to be kept up to date in 2 of the scripts, and it makes it real heavy... Then again with a peak of 5 users, I'm not that sure it's really worth it =p Oh well...
Btw, if you know of an editor that does it, let me knoooooow !!! =)
Also, the ability of being able to reset the script right away and see how things go is pretty nifty, but that's about it =p
Now that Ender told me it worked, I've been spending the whole morning pondering if I should just keep everything as is, or settle for a notepad and combine Zeus with ZeusAux1 and ZeusAux2 =p
One of the dictionaries has to be kept up to date in 2 of the scripts, and it makes it real heavy... Then again with a peak of 5 users, I'm not that sure it's really worth it =p Oh well...
Good VB Script Highlighter and more..
Visit http://www.kt2k.com/ for AEdiX, it does various programming languages, including VB Script hightlighting. Is great to me.
Also, another way to work Large scripts. This method makes it easy to edit and restart a bot without worring about size. This goes into the main .script file. Of course any edits to it while hub is running must be made via the hub editor. But the extra parts can be edit with text editor. All the need to be done to enable the changes is Restart the main .script
Word of warning!!! The message box is there to make sure no errors occur in the external part. If an error exists there, there is no error message and the msgbox doesn't come up.
Also, another way to work Large scripts. This method makes it easy to edit and restart a bot without worring about size. This goes into the main .script file. Of course any edits to it while hub is running must be made via the hub editor. But the extra parts can be edit with text editor. All the need to be done to enable the changes is Restart the main .script
Word of warning!!! The message box is there to make sure no errors occur in the external part. If an error exists there, there is no error message and the msgbox doesn't come up.
Code: Select all
Sub Main()
ExecuteGlobal GetFileContents(sAppPath & "BotPart2.txt")
msgbox "Bot Loaded!"
End Sub
Function GetFileContents(sFileName)
Dim FSO, ScriptFile
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ScriptFile = FSO.OpenTextFile(sFilename,1)
GetFileContents = ScriptFile.ReadAll
Set ScriptFile = Nothing
Set FSO = Nothing
End Function
Owner of Lurkers Lair a Phoenix Rising Hub
-
- Posts: 210
- Joined: 2003-01-23 17:24
- Location: Nevada
- Contact:
*adopted AEdiX because it's really neat* =)
Just in case I wasn't the only one not to know about it, this is the config file AEdiXmain.amf , modified to support the same size of tabulation as the NMDC script editor, recognize and highlight the .script files in VBS/asp, and get rid of the damn grey bar =)
Nothing exceptional, but it might save you some time if you don't want want to figure it out by yourself :
-----
And of course, thanks for the bot loader =)
Just in case I wasn't the only one not to know about it, this is the config file AEdiXmain.amf , modified to support the same size of tabulation as the NMDC script editor, recognize and highlight the .script files in VBS/asp, and get rid of the damn grey bar =)
Nothing exceptional, but it might save you some time if you don't want want to figure it out by yourself :
Code: Select all
Program MainAEditScript;
Procedure OnInit;
begin
Editor.SetTabWidth(3);
Editor.SetSmartTabs(False);
Editor.SetRightEdge(0);
end;
Procedure OnFileLoad(Name:string);
begin
if (trim(extractfileext(uppercase(name)))='.SCRIPT') then Document.SynSelectChange(7);
end;
Begin
//do not write nothing here
end.
And of course, thanks for the bot loader =)