Author | Message | Time |
---|---|---|
Yegg | Ok, Im trying to get my bot to connect as soon as the bot is opened, and I also want to be able to check a checkbox to determine if this will happen or not. Can anyone help me with the code I need to enter to make this happen? | August 21, 2004, 10:01 PM |
Kp | Yes. Create a button; on exit from the program, save whether the button was checked. On startup, load that setting from registry/disk/wherever, and if it says the button was checked, call your connect method immediately. | August 21, 2004, 10:16 PM |
Yegg | Im not sure i really understand that, but is there a way I can make something automatically "run" when I open the bot. I cna figure out the rest on my own. | August 21, 2004, 11:12 PM |
Kp | [quote author=Yegg link=board=17;threadid=8289;start=0#msg76634 date=1093129921]Im not sure i really understand that, but is there a way I can make something automatically "run" when I open the bot. I cna figure out the rest on my own.[/quote] Yes. Put it in the entry point function, which is typically main (Win32 console / Unix), or WinMain (Win32 GUI). Alternate names are needed if you want to get Unicode native parameters. | August 21, 2004, 11:40 PM |
LordNevar | Or on Form_Load, just call your connect call and it should start the logon sequence. Or you can do what was previoulsy posted and make a button to call on when you load your bot. | August 22, 2004, 12:22 PM |
l2k-Shadow | Supposing that you have Getstuff and WriteStuff functions: In config form: [code] Private Sub SaveButton_Click() Writestuff "Misc","ConnectOnStartup", YourCheckBoxName End Sub Private Sub Form_Load() YourCheckBoxName = Getstuff("Misc","ConnectOnStartup") End Sub 'Main Form Private Sub Form_Load() If Getstuff("Misc","ConnectOnStartup") = "1" Then 'Connect Coding Goes Here End if End Sub [/code] :) | August 22, 2004, 8:27 PM |