Valhalla Legends Forums Archive | Battle.net Bot Development | A tricky problem...

AuthorMessageTime
Atom
I load all of my VbScript into the MsScript control on startup. I have it so you can edit the code from my bot's control panel... but i have no way to add the code after its edited.

There is no clearcode function on the control... there is no way to get rid of the old code!

Im thinking of unloading the control, but im not quite sure how i could reload after i do so... so maybe somebody can come up with a quick fix?

Tested Code, PLZ!  ::) ::) ::)
February 12, 2003, 7:34 PM
St0rm.iD
Make the changes to the script file and call this.

[code]
Public Sub LoadScript()
   On Error Resume Next 'ignore when someone connects multiple times or deletes their script
   Dim f As Long
   Dim tmp As String
   Dim final As String
   
   If ScriptFile = "" Then Exit Sub
   
   frmTimers.ClearTimers
   
   frmMain.Scripting.Reset
   frmMain.Scripting.language = ScriptLanguage
   frmMain.Scripting.AddObject "Bot", Bot
   
   f = FreeFile
   Open App.path & "\" & ScriptFile For Input As #f
   
   Do While Not EOF(f)
       Line Input #f, tmp
       final = final & tmp & vbNewLine
   Loop
   
   Close #f
   
   frmMain.Scripting.AddCode final
End Sub
[/code]
February 12, 2003, 8:04 PM
Atom
Once again i feel like a complete and utter moron. Thank you Storm.id!

[code]
frmmain.scripting.reset
[/code]

Thats all i needed!
February 12, 2003, 8:24 PM

Search