Sign in to follow this  
Followers 0
Elsys

My Botting Script

3 posts in this topic

Ok so I get a few compiler errors with this script and its probably a really simple fix but this is my first autoit experience so I thought I was doing preatty well for myself. The script isnt entirely finished yet but its getting close.

Also I was under the impression that explicit declarations were not required but obviously they are... Either that or its a syntax error or somthing.

#include <GUIConstants.au3>
#include "buffconfig.au3"
#include "buff3.au3"
#include "buff2.au3"
#include "buff1.au3"
#include "autoloot.au3"
#include "hpmp.au3"
#include "autoattk.au3"
#include "ELBot.au3"
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\ChristopherMcCormack\My Documents\Elbot.kxf
$Form1 = GUICreate("EL Bot", 301, 401, -1, -1)
GUISetIcon("C:\Program Files\Wizet\MapleStory\MapleStory.exe")
GUISetBkColor(0xFFFFFF)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "AForm1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "AForm1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "AForm1Restore")
$Button1 = GUICtrlCreateButton("(Not allowed)", 224, 32, 41, 37, $BS_BITMAP)
GUICtrlSetImage($Button1, "C:\Documents and Settings\ChristopherMcCormack\My Documents\BlurMetalDc0.bmp")
GUICtrlSetOnEvent(-1, "AButton1Click")
GUICtrlSetTip(-1, "Launch MS")
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\ChristopherMcCormack\My Documents\1024x768_1.jpg", 0, 0, 297, 377, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetOnEvent(-1, "APic1Click")
$Label1 = GUICtrlCreateLabel("EL Bot Version 1.0", 24, 32, 124, 20)
GUICtrlSetFont(-1, 8, 800, 0, "System")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetOnEvent(-1, "ALabel1Click")
$List1 = GUICtrlCreateList("", 200, 160, 89, 110)
GUICtrlSetData(-1, "3 Diffrent Buffs|AutoAttack|AutoLoot|Configuration|Hp Bot|Mp Bot")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetOnEvent(-1, "AList1Click")
$MenuItem1 = GUICtrlCreateMenu("File")
$MenuItem2 = GUICtrlCreateMenuItem("Open Config", $MenuItem1)
$MenuItem3 = GUICtrlCreateMenuItem("Save Config", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Exit", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenu("Help")
$MenuItem6 = GUICtrlCreateMenuItem("Readme", $MenuItem5)
$MenuItem7 = GUICtrlCreateMenuItem("About", $MenuItem5)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Opt("MouseCoordMode", 0)
While 1
    Sleep(100)
WEnd
        
Func AButton1Click()
Run("C:\Program Files\Wizet\MapleStory\MapleStory.exe")
EndFunc

        
Func AForm1Close()  
MsgBox(0, "Close", "Exiting...")
Exit
EndFunc

        
Func AForm1Maximize()
GUISetState(@SW_MAXIMIZE)
EndFunc

        
Func AForm1Minimize()
GUISetState(@SW_MINIMIZE)
EndFunc

        
Func AForm1Restore()
GUISetState(@SW_RESTORE)
EndFunc

Func OpenConfig()
GUICtrlSetOnEvent($MenuItem2, "KeyConfig")
EndFunc

Func ConfigSave()
GUICtrlSetOnEvent($MenuItem3, "configsave")
EndFunc

Func menexit()
GUICtrlSetOnEvent($MenuItem3, "AForm1Close")
EndFunc

My Main GUI

Opt("SendKeyDelay", 10)
While 1 = 1

HotKeySet("{"&$hotkey1&"}", "GrabMana")

HotKeySet("{"&$hotkey2&"}", "GrabHP")

HotKeySet("{"&$hotkey7&"}", "prepoth")

HotKeySet("{"&$hotkey8&"}" , "prepotm")

HotKeySet("{"&$hotkey3&"}", "PreBuff1")

HotKeySet("{"&$hotkey4&"}", "PreBuff2")

HotKeySet("{"&$hotkey5&"}", "PreBuff3")

HotKeySet("{"&$hotkey6&"}" , "Autoattk")

HotKeySet("{"&$hotkey7&"}" , "Autoloot")
WEnd

Hotkeys

Func KeyConfig()
Global $delay1 = InputBox("Buff Delay1", "Please Enter your desired buff delay for your first buff in Seconds.", "Seconds")
Global $delay2 = InputBox("Buff Delay2", "Please Enter your desired buff delay for your second buff in Seconds.", "Seconds")
Global $delay3 = InputBox("Buff Delay3", "Please Enter your desired buff delay for your third buff in Seconds.", "Seconds")
Global $buffkey1 = InputBox("Buff Key1", "Please Enter your desired buff key for your first buff.", "Key")
Global $buffkey2= InputBox("Buff Key2", "Please Enter your desired buff key for your second buff.", "Key")
Global $buffkey3 = InputBox("Buff Key3", "Please Enter your desired buff key for your third buff.", "Key")
Global $autoakey = InputBox ("Auto Attack Key" , "Please Enter your desired Auto Attack Key." , "Key")
Global $autolkey = InputBox ("Auto Loot Key" , "Please Enter your desired Auto Loot Key." , "Key")
Global $authpot = InputBox ("HP Pot Key" , "Please Enter your desired HP Pot Key." , "Key")
Global $autmpot = InputBox ("MP Pot Key" , "Please Enter your desired MP Pot Key." , "Key")
Global $hotkey1 = InputBox ("Hotkey" , "Please Enter your desired Mana Set Key." , "Key")
Global $hotkey2 = InputBox ("Hotkey" , "Please Enter your desired HP Set Key." , "Key")
Global $hotkey3 = InputBox ("Hotkey" , "Please Enter your desired Buff 1 Key." , "Key")
Global $hotkey4 = InputBox ("Hotkey" , "Please Enter your desired Buff 2 Key." , "Key")
Global $hotkey5 = InputBox ("Hotkey" , "Please Enter your desired Buff 3 Key." , "Key")
Global $hotkey6 = InputBox ("Hotkey" , "Please Enter your desired Attack Set Key." , "Key")
Global $hotkey7 = InputBox ("Hotkey" , "Please Enter your desired Loot Set Key." , "Key")
Global $hotkey8 = InputBox ("Hotkey" , "Please Enter your desired Mana Heal Hot Key." , "Key")
Global $hotkey9 = InputBox ("Hotkey" , "Please Enter your desired HP Heal Hotkey." , "Key")
MsgBox(48, "Successful", "You have succesfully configured EL Bot to your settings", 5)
EndFunc

My configuration wizard which dumps into variables all over the script and into a text file in my save config script

Func configsave()
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
Send ("Buff Key 1")
Send ("{"&$buffkey1&"}")
Send ("Buff Key 2")
Send ("{"&$buffkey2&"}")
Send ("Buff Key 3")
Send ("{"&$buffkey3&"}")
Send ("Delay 1")
Send ("{"&$delay1&"}")
Send ("Delay 2")
Send ("{"&$delay2&"}")
Send ("Delay 3")
Send ("{"&$delay3&"}")
Send ("Auto Attack")
Send ("{"&$autoakey&"}")
Send ("Auto Loot")
Send ("{"&$autolkey&"}")
Send ("^s")
Send ("EL Bot Config")
Send ("{Enter}")
MsgBox(48, "Successful", "You have succesfully saved your settings", 5)
EndFunc

This is my save proceedure and I will be writing a open proceedure that will grab these variables and plug them back into the script.

Global $AutoatkRun = 0
Func Autoattk() 
  $AutoatkRun = Not $AutoatkRun
     While 1
          If Not $AutoatkRun Then Return
          send ("{"&$autoakey&"}")
     WEnd
 EndFunc

Auto Attack Macro

Global $AutoLootRun = 0
Func Autoloot() 
    $AutoLootRun = Not $AutoLootRun
    While 1
        if Not $AutoLootRun Then Return
        Send ("{"&$autolkey&"}")
    WEnd
EndFunc

Autoloot Macro

$hpsearch = PixelSearch( 584, 595, 218, 321, $hppos ) 
$mpsearch = PixelSearch( 585, 595, 328, 430, $manapos )

Func GrabMana()
$manapos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6)
EndFunc

Func GrabHp()
$hppos = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6)
EndFunc

Func prepoth()
    AdlibEnable ("hprepot", 250)
EndFunc

Func hprepot()
    If $hpsearch <> $hppos Then
    Send("{"&$authpot&"}")
EndIf
EndFunc

Func prepotm()
AdlibEnable ( "mprepot" , 250)
EndFunc

Func mprepot()
    If $mpsearch <> $manapos Then
    Send("{"&$autmpot&"}")
EndIf
EndFunc

Auto Potion Macro

Global $condelay1 = 0

Func PreBuff1()
    $condelay1 = ($delay1 * 1000)
    AdlibEnable ( "Buff1" , $condelay1)
EndFunc 

Func Buff1()    
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
EndFunc

Buffing Macro Their are 2 other snipets like this one they all do the same thing but on different keys

Global $condelay1 = 0

Func PreBuff1()
    $condelay1 = ($delay1 * 1000)
    AdlibEnable ( "Buff1" , $condelay1)
EndFunc 

Func Buff1()    
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
Send ("{"&$buffkey1&"}")
EndFunc

Global $condelay3 = 0

Func PreBuff3()

$condelay2 = ($delay3 * 1000)

AdlibEnable ( "Buff3" , $condelay3)

EndFunc

Func Buff3()

Send ("{"&$buffkey3&"}")

Send ("{"&$buffkey3&"}")

Send ("{"&$buffkey3&"}")

Send ("{"&$buffkey3&"}")

Send ("{"&$buffkey3&"}")

EndFunc

I was trying really hard not to ask for help Ive been up for 48 hours tweaking this thing... Id really really appreciate it if somone would help me see where I made mistakes in syntax and or show more effciant procedures and explain why the syntax is formated in that way and or what makes those proceedures more effcient. Then again if thats too much work you dont have to explain I was just really interested in learning.

I have attached a zip with the script files in it as well if thats any help.

EL_Bot.zip

Share this post


Link to post
Share on other sites



Some tips:

- explicitly declare your global variables which are used inside your functions to avoid compiler warnings ($condelay2)

- HotKeySet() inside Whil1 1=1 Loop --> ?why? it's enough once (ELBOT.au3)

- ERROR: APic1Click(): undefined function.

ERROR: ALabel1Click(): undefined function.

- 10 smalll include files make whole script unreadable

I didn't go through all your files

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

XD Oddly enough you should've searched for some info on MapleStory on these forums first :| I asked a question a few days ago why I couldn't send info to the program. Its because of nProtect that MS uses, it hooks into your APIs and then it blocks the normal send functions and controlsend functions that AutoIt uses. Now I heard some people say you could use GGK (GameGuard Killer) while MS is loading so that your bots will work, never tried for myself though :| But I do know that you can just go find a copy of MSBot v0.0.1.5 I think is what I use. And it has attacking, looting, and autopotion built into it.

EDIT: Thought I might add, pretty sure MSBot was done in ACTool, so dunno if it's completely different on how it sends stuff, but it does include a .dll with it that I couldn't pull any functions out of that may come in handy.

Edited by luvmachine

Share this post


Link to post
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
Sign in to follow this  
Followers 0