Jump to content

Help with a bot.


Recommended Posts

hey. i recently created a bot for MapleStory, it works and all, but i cant get 2 diffrent loops to run at the same time. i set 2 hotkeys, one to loop ctrl and one to loop z. only one of them works at a time >< if anyone could help me figure this out that would be great.

Link to comment
Share on other sites

hey. i recently created a bot for MapleStory, it works and all, but i cant get 2 diffrent loops to run at the same time. i set 2 hotkeys, one to loop ctrl and one to loop z. only one of them works at a time >< if anyone could help me figure this out that would be great.

you can only have one thread executing at a time. one way around it would be to use an adlib function, that checks boolean variables every x milliseconds, then if both switches are true, send both keys, otherwise, just send the key (control or z) corresponding to the right switch. if you need them at different intervals etc, you're going to need to create a true multithreaded approach, and have 3 seperate scripts, instead of 1 script with 2 seperate functions. so the hotkey for keep pressing z would call a script to do just that, but the hotkey for control would call a diff script, and they could both run on their own
Link to comment
Share on other sites

how would i do it with the adlib function.

BTW, heres the code i have now [the close button doesnt work but im planning on fixing it now cuz its not as important]

HotKeySet("{F9}", "_AutoLoot")
HotKeySet("{F10}", "_Autoatk")
HotKeySet("{F11}", "_Autoclicker")
HotKeySet("{NUMLOCK}", "_Exito")
Global $AutojumpRun = 0
Global $AutoLootRun = 0
Global $AutoatkRun = 0
Global $AutoclickerRun = 0
Global $ExitoRun = 0

While 1
     Sleep(100)
WEnd

Func CLOSEClicked()
  Exit
EndFunc

Func _AutoLoot()
     $AutoLootRun = Not $AutoLootRun
     While 1
          If Not $AutoLootRun Then Return
          send ("z")
          Opt("SendKeyDelay", 10)
     WEnd
 EndFunc

Func _Autoatk()
     $AutoatkRun = Not $AutoatkRun
     While 1
          If Not $AutoatkRun Then Return
          send ("^")
          Opt("SendKeyDelay", 10)
     WEnd
 EndFunc

Func _Autoclicker()
     $AutoclickerRun = Not $AutoclickerRun
     While 1
          If Not $AutoclickerRun Then Return
          MouseClick("left")
          Opt("MouseClickDelay", 1)
     WEnd
 EndFunc
 
 Func _Autojump()
     $AutojumpRun = Not $AutojumpRun
     While 1
          If Not $AutojumpRun Then Return
          Send("{SPACE}")
          Opt("SendKeyDelay", 10)
     WEnd
 EndFunc
 
 Func _Exito()
     $ExitoRun = Not $ExitoRun
     While 1
          If Not $ExitoRun Then Return
          exit
     WEnd
EndFunc
Edited by Flamingwolf
Link to comment
Share on other sites

Lol Group Project XD

Im looking up booleans I think I know what he is getting at

i'm at work right now, so i only have time for a quick explain. say you've got 2 keys you want to send, you have one variable $send1, one $send2 they're declared globally so that your adlib sees them. if $send1 and $send2 then $tosend = 'z^', else if $send1 then $tosend = 'z' else $tosend = '^' ENDIF ENDIF ... Send($tosend).... make sense?
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...