TK_Incorperate Posted December 6, 2005 Posted December 6, 2005 (edited) Ok well i'm trying to create a spam bot for D2... and it was going good all up until one part.... well see this bot enters games, so in order to do so i want people to have a choice, to either do normal, nightmare, or hell games... and to do so they'd have to chose a character witch can join either nightmare or hell if they want it... so what i've done is added a char selection function, thats tied to .ini... Now for the problem, i tried putting other things AFTER the functions, and it wont work... i guess the endfunc ends the script completely, cuz once its done chosing the character, the script closes... and i was just wondering if i could do these functions without the "EndFunc" ending the script completely... Now in my script (witch i will show you soon) after the funcs i have put the enter game sequence, and i've even tried putting it before the funcs right after it reads the char from the .ini and it still wont do anything else after it choses the character. Here's the script so far. (yes there's going to be more then 2 characters selectable, that's just for testing) expandcollapse popupSend("{ALT}+{TAB}") WinMove("Diablo II", "", 0, 0) Sleep(2000) MouseClick("left", 300, 375) Sleep(4000) Send("{TAB}") $Acct = IniRead("TKPB.ini", "Spam Bot Main", "Acct", "acct") Send($Acct) Send("{TAB}") $Pass = IniRead("TKPB.ini", "Spam Bot Main", "Pass", "pass") Send($Pass) Send("{ENTER}") $Char = IniRead("TKPB.ini", "Spam Bot Main", "Pos", "1") If $Char = 1 Then Char1() If $Char = 2 Then Char2() Func Char1() Sleep(3000) MouseClick("left", 182, 157) Send("{ENTER}") EndFunc Func Char2() Sleep(3000) MouseClick("left", 453, 154) Send("{ENTER}") EndFunc MouseClick("left", 182, 157) $Game = IniRead("TKPB.ini", "Entering Game", "Game", "GamerzVault.com") Send($Game) Send("{TAB}") $Gp = IniRead("TKPB.ini", "Entering Game", "Pass", "TK_Incorperate") Send($Gp) Send("{ENTER}") Edited December 6, 2005 by TK_Incorperate
dabus Posted December 6, 2005 Posted December 6, 2005 (edited) No, EndFunc will not end the script. Since I do not now this game-dialog, I'd suggest that you add a debug MsgBox to see what's going on. Maybe there should be another sleep (X*1000 ) ? Edited December 6, 2005 by dabus
TK_Incorperate Posted December 6, 2005 Author Posted December 6, 2005 1) I dont know how to add a debug msgbox and dont know the purpose of that anyways 2) I tried adding another sleep inside the func's and outside of them, and it doesnt help any
TK_Incorperate Posted December 6, 2005 Author Posted December 6, 2005 (edited) Ok i tried deleting the first thing that comes after the functions, witch is the mouseclick, and put in a delay so i could make the click myself... and it seems it works fine, it was the mouseclick that was causing the script to exit... but i looked at it and it dont appear to have anything wrong with it... any ideas? Edit: i even tried putting the mouseclick in the func... still didnt work Edited December 6, 2005 by TK_Incorperate
Moderators SmOke_N Posted December 6, 2005 Moderators Posted December 6, 2005 Well, I doubt seriously it was the mouseclick. When you call a function, are you returning to a loop? If you do not have a loop in your script, it will exit after all the commands have been done. And if you are going to say "Yes" there is a loop... Before doing that and someone else replying... 'Well show us the loop', go ahead and post the rest of the script. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
TK_Incorperate Posted December 6, 2005 Author Posted December 6, 2005 lol nevermind, i found out what my problem was lol and it was the mouseclick, thanks anyways ~TK
Moderators SmOke_N Posted December 6, 2005 Moderators Posted December 6, 2005 Well since you asked for help, do you mind posting exactly what the solution was, in case someone does a search, comes across your thread as something they think might be their problem.... See's there was a solution, but there is none there. Could frustrate some new/old members. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now