Jump to content

pls help me, im a noob


 Share

Recommended Posts

hi all :P

how can i enter different timings to repeat F1 and F2? On F1 are attacks, they should repeat fast. On F2 are buffs and they should only repeat e.g. every 400 sec. My problem is now either script is switching very fast between F1 and F2, or it pauses completly for 400 sec after it uses the F2 part.

Work with autoit since yesterday, so im a complete noob. Here is the text that i have:

$autotarget = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget", "notfound")
$autotarget2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget2", "notfound")
$autoattack = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack", "notfound")
$autoattack2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack2", "notfound")
$autoattack3 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack3", "notfound")
$autoattack4 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack4", "notfound")


;~ AutoTarget and AutoAttack

If $autotarget = "notfound" Then

$autotarget1 = InputBox ("AutoTarget", "Did you put autotarget on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS), and nothing more !") 


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget", $autotarget1)



EndIf


If $autotarget2 = "notfound" Then


$autotarget22 = InputBox ("AutoTarget2", "On which skill box you put autotarget ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget2", $autotarget22)


EndIf


If $autoattack = "notfound" Then



$autoattack1 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS!!!), nothing more !")


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack", $autoattack1)



EndIf


If $autoattack2 = "notfound" Then


$autoattack22 = InputBox ("AutoAttack2", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack2", $autoattack22)


MsgBox (64, "Exit...", "SimpleBot will now exit, because it finished saving skills. Please run again, and read further instructions ! (If you're already logged in SRO, just run the bot again, no need for exiting SRO;)")



Exit


EndIf





If $autoattack3 = "notfound" Then



$autoattack3 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F2} (WITH BRACKETS!!!), nothing more !")


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack3", $autoattack3)



EndIf
 


If $autoattack4 = "notfound" Then


$autoattack4 = InputBox ("AutoAttack4", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack4", $autoattack4)




Exit


EndIf




Sleep (2000)


$a2 = WinActivate ("SRO_Client")



If $a2 = 0 Then


            MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")



            Exit


EndIf





Sleep (2000)




 


 


;~ Botting (((simple botting, just killing mobs)))


While 1



$a3 = WinActivate ("SRO_Client")


If $a3 = 0 Then



            MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")


            Exit



EndIf




Send ($autotarget)  



Sleep (200)


Sleep (200)



Send ($autotarget2)  


Sleep (200)



Send ($autoattack)  


Sleep (200)



Send ($autoattack2) 


Sleep (200)


Send ($autoattack3)

Sleep (500)

Send ($autoattack4)





WEnd
Link to comment
Share on other sites

hi all :P

how can i enter different timings to repeat F1 and F2? On F1 are attacks, they should repeat fast. On F2 are buffs and they should only repeat e.g. every 400 sec. My problem is now either script is switching very fast between F1 and F2, or it pauses completly for 400 sec after it uses the F2 part.

Work with autoit since yesterday, so im a complete noob. Here is the text that i have:

$autotarget = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget", "notfound")
$autotarget2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget2", "notfound")
$autoattack = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack", "notfound")
$autoattack2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack2", "notfound")
$autoattack3 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack3", "notfound")
$autoattack4 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack4", "notfound")


;~ AutoTarget and AutoAttack

If $autotarget = "notfound" Then

$autotarget1 = InputBox ("AutoTarget", "Did you put autotarget on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS), and nothing more !") 


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget", $autotarget1)



EndIf


If $autotarget2 = "notfound" Then


$autotarget22 = InputBox ("AutoTarget2", "On which skill box you put autotarget ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget2", $autotarget22)


EndIf


If $autoattack = "notfound" Then



$autoattack1 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS!!!), nothing more !")


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack", $autoattack1)



EndIf


If $autoattack2 = "notfound" Then


$autoattack22 = InputBox ("AutoAttack2", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack2", $autoattack22)


MsgBox (64, "Exit...", "SimpleBot will now exit, because it finished saving skills. Please run again, and read further instructions ! (If you're already logged in SRO, just run the bot again, no need for exiting SRO;)")



Exit


EndIf





If $autoattack3 = "notfound" Then



$autoattack3 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F2} (WITH BRACKETS!!!), nothing more !")


IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack3", $autoattack3)



EndIf
 


If $autoattack4 = "notfound" Then


$autoattack4 = InputBox ("AutoAttack4", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")



IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack4", $autoattack4)




Exit


EndIf




Sleep (2000)


$a2 = WinActivate ("SRO_Client")



If $a2 = 0 Then


            MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")



            Exit


EndIf





Sleep (2000)




 


 


;~ Botting (((simple botting, just killing mobs)))


While 1



$a3 = WinActivate ("SRO_Client")


If $a3 = 0 Then



            MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")


            Exit



EndIf




Send ($autotarget)  



Sleep (200)


Sleep (200)



Send ($autotarget2)  


Sleep (200)



Send ($autoattack)  


Sleep (200)



Send ($autoattack2) 


Sleep (200)


Send ($autoattack3)

Sleep (500)

Send ($autoattack4)





WEnd
Have a look at the _Timer_SetTimer function.

The help doesn't say, but you need to have 4 parameters in the function called as in the example even though you might not use them, or it won't work.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Now your script more easyer to read :P

$autotarget = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget", "notfound")
$autotarget2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autotarget2", "notfound")
$autoattack = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack", "notfound")
$autoattack2 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack2", "notfound")
$autoattack3 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack3", "notfound")
$autoattack4 = IniRead (@ScriptDir & "\settings.ini", "Skills", "autoattack4", "notfound")

;~ AutoTarget and AutoAttack

If $autotarget = "notfound" Then
    $autotarget1 = InputBox ("AutoTarget", "Did you put autotarget on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS), and nothing more !") 
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget", $autotarget1)
EndIf

If $autotarget2 = "notfound" Then
    $autotarget22 = InputBox ("AutoTarget2", "On which skill box you put autotarget ? From 0 - 9 ! Write only the number which you put!")
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autotarget2", $autotarget22)
EndIf

If $autoattack = "notfound" Then
    $autoattack1 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F1} (WITH BRACKETS!!!), nothing more !")
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack", $autoattack1)
EndIf

If $autoattack2 = "notfound" Then
    $autoattack22 = InputBox ("AutoAttack2", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack2", $autoattack22)
    MsgBox (64, "Exit...", "SimpleBot will now exit, because it finished saving skills. Please run again, and read further instructions ! (If you're already logged in SRO, just run the bot again, no need for exiting SRO;)")
    Exit
EndIf

If $autoattack3 = "notfound" Then
    $autoattack3 = InputBox ("AutoAttack", "Did you put autoattack on F1, F2, F3 or F4 ? Write ONLY for ex. {F2} (WITH BRACKETS!!!), nothing more !")
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack3", $autoattack3)
EndIf

If $autoattack4 = "notfound" Then
    $autoattack4 = InputBox ("AutoAttack4", "On which skill box you put autoattack ? From 0 - 9 ! Write only the number which you put!")
    IniWrite(@ScriptDir & "\settings.ini", "Skills", "autoattack4", $autoattack4)
    Exit
EndIf

Sleep (2000)
$a2 = WinActivate ("SRO_Client")

If $a2 = 0 Then
    MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")
    Exit
EndIf

Sleep (2000)

;~ Botting (((simple botting, just killing mobs)))

While 1
    $a3 = WinActivate ("SRO_Client")
    If $a3 = 0 Then
        MsgBox (64, "Not found!", "SRO_Client not found. Please make sure you did NOT rename your client to anything else than SRO_Client! Restart the bot after you rename/start SRO !")
        Exit
    EndIf
        Send ($autotarget)  
        Sleep (200)
        Sleep (200)
        Send ($autotarget2)  
        Sleep (200)
        Send ($autoattack)  
        Sleep (200)
        Send ($autoattack2) 
        Sleep (200)
        Send ($autoattack3)
        Sleep (500)
        Send ($autoattack4)
WEnd

I hope $autoatack3 is your buff button. Script will spam $autotarget, $autotarget2, $autoattack, $autoattack2, $autoattack4, button all the time, and will use $autoattack3 at startup and every 400 seconds later.

Have not been tested

Edited by Belfigor

[size="1"]My bear is so cute asleep in the closet, not even drinking vodka. My nuclear bomb name is Natasha.[/size]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...