Jump to content
Sign in to follow this  
AngelOfMercy

New to all coding.

Recommended Posts

AngelOfMercy

Hey people. Im new to coding and tried makin a bot for a game. I have the bot working but only through following my mouse actions. I just need abit of help getting the script to read the gui input box's, I have read tutorials and youtube vids and got no where. i tried the learning to script with autoit v3 and think it's the 4.3 Assigning variable values. but there is no demo code :x so im still lost.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Paused

$Form1 = GUICreate("AngelBot v0.1", 289, 353, 325, 174)
$Menumain = GUICtrlCreateMenu("General")
$MenuItem6 = GUICtrlCreateMenuItem("Load", $Menumain)
$MenuItem5 = GUICtrlCreateMenuItem("Load Settings", $Menumain)
$MenuItem4 = GUICtrlCreateMenuItem("Save", $Menumain)
$MenuItem3 = GUICtrlCreateMenuItem("Save As", $Menumain)
$exit = GUICtrlCreateMenuItem("Exit", $Menumain)
$menu2 = GUICtrlCreateMenu("About")
$MenuItem7 = GUICtrlCreateMenuItem("Documentation", $menu2)
$MenuItem1 = GUICtrlCreateMenuItem("Version", $menu2)
$MenuItem8 = GUICtrlCreateMenuItem("Help", $menu2)
$MenuItem2 = GUICtrlCreateMenuItem("Website", $menu2)
GUISetBkColor(0x000000)
$startmining = GUICtrlCreateButton("Start Mining", 8, 280, 113, 41)
GUICtrlSetFont(-1, 14, 400, 0, "Papyrus")
GUICtrlSetBkColor(-1, 0xC0C0C0)
$Group1 = GUICtrlCreateGroup("", 8, 96, 113, 169)
$Drones = GUICtrlCreateCheckbox("Drones", 16, 112, 97, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$cargoboxs = GUICtrlCreateCheckbox("CBox", 16, 136, 97, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Jettison = GUICtrlCreateCheckbox("Jettison", 16, 160, 97, 17)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$lazramm = GUICtrlCreateCombo("1", 16, 184, 33, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1|2|3")
$lasamm = GUICtrlCreateLabel("Laser", 56, 184, 44, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Label1 = GUICtrlCreateLabel("Laser*", 57, 208, 50, 24)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$lzramm = GUICtrlCreateInput("180", 16, 208, 33, 21)
$Input4 = GUICtrlCreateInput("Input4", 16, 232, 33, 21)
$Label8 = GUICtrlCreateLabel("Trvltime", 56, 232, 60, 29)
GUICtrlSetFont(-1, 12, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 128, 0, 153, 329)
$astlist = GUICtrlCreateCombo("Veldspar", 136, 40, 137, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Veldspar|Scordite|Pyroxeres|Plagioclase|Omber|Kernite|Jaspet|Hemorphite|Hedbergite|Gneiss|Dark Ochre|Crokite|Spodumain|Bistot|Arkanor|Mercoxit|Condensed Alloy|Crystal Compound|Precious Alloy|Sheen Compound|Gleaming Alloy|Lucent Compound|Dark Compound|Motley Compound|Lustering Alloy|Glossy Compound|Plush Compound|Opulent Compound")
$Label2 = GUICtrlCreateLabel("Asteroids:", 167, 11, 75, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FF00)
$List1 = GUICtrlCreateList("", 136, 72, 137, 71)
GUICtrlSetData(-1, "")
$Label3 = GUICtrlCreateLabel("Emergency", 188, 197, 73, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Label4 = GUICtrlCreateLabel("Logoff", 203, 213, 41, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Cargobox = GUICtrlCreateCheckbox("", 144, 208, 17, 17)
$Label6 = GUICtrlCreateLabel("Container", 203, 303, 61, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Label5 = GUICtrlCreateLabel("Bookmarks", 203, 271, 73, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Label7 = GUICtrlCreateLabel("Cargo", 203, 239, 61, 20)
GUICtrlSetFont(-1, 10, 400, 0, "Papyrus")
GUICtrlSetColor(-1, 0x00FF00)
$Input1 = GUICtrlCreateInput("10", 136, 264, 33, 21)
$Input3 = GUICtrlCreateInput("Name", 136, 296, 33, 21)
$Input2 = GUICtrlCreateInput("Size", 136, 232, 33, 21)
$Addore = GUICtrlCreateButton("Add", 144, 152, 51, 17)
$Remore = GUICtrlCreateButton("Remove", 208, 152, 51, 17)
$oreup = GUICtrlCreateButton("Up", 144, 176, 51, 17)
$oredown = GUICtrlCreateButton("Down", 208, 176, 51, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\matt\My Documents\My Pictures\alien head.jpg", 8, 16, 113, 81, BitOR($GUI_SS_DEFAULT_PIC,$WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If  $nmsg = $startmining Then startmining()
    If  $nmsg = $exit Then Exit
    HotKeySet("{PAUSE}", "TogglePause")
    HotKeySet("{ESC}", "Terminate")
    HotKeySet("+!d", "ShowMessage")
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func startmining()

    $var = MsgBox(0,"","Please make sure eve is ready check help doc Before starting.")


_WinWaitActivate("EVE","")
    opt("MouseClickDelay", 25000)
MouseClick("left",18,748,1)
    Opt("MouseClickDelay", 5000)
MouseClick("right",111,291,1)
    Opt("MouseClickDelay", 2000)
MouseClick("left",162,301,1,2000)
    Opt("MouseClickDelay", 54000)
MouseClick("right",762,207,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",790,262,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",737,222,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",780,274,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",620,656,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",499,63,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",662,655,1)
    Opt("MouseClickDelay", 180000)
MouseClick("right",724,560,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",770,584,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",762,207,1)
    Opt("MouseClickDelay", 2000)
MouseClick("left",790,262,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",737,222,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",762,207,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",790,262,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",737,222,1)
    Opt("MouseClickDelay", 2000)
MouseClick("left",780,274,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",620,656,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",759,579,1)
    Opt("MouseClickDelay", 15000)
MouseClick("left",838,620,1)
    Opt("MouseClickDelay", 2000)
MouseClick("left",499,63,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",662,655,1)
    Opt("MouseClickDelay", 1000)
MouseClick("right",167,205,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",217,260,1)
    Opt("MouseClickDelay", 80000)
MouseClick("right",439,103,1)
    Opt("MouseClickDelay", 1000)
MouseClick("left",523,108,1)
    Opt("MouseClickDelay", 1000)
Mouseclickdrag("left",470,216,130,718,3000)

EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd


    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc



Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

$i = $Label8
Do
   MouseClickDelay $Label8
    $i = $Label8 + 1
Until $i = $label8

as you can see i have tried a Do to read the input box lol xD If somebody could please show me how it would be done id well appreciate it. Aslong as i know hot to read from the input box's im sure the rest is self explanitary with the autoit help and youtube.

for e.g i have

lzramm = GUICtrlCreateInput("180", 16, 208, 33, 21)
this is the input ammount that tells A mouseklick to wait for ammount of time that was inputted Edited by AngelOfMercy

Share this post


Link to post
Share on other sites
AngelOfMercy

Bots for games are not tolerated here.

Topic reported.

lol it was the 1st thing i thought to make. i play alot of age of empires and my target is to make a macro to build my base (Dam that bits boring) so instead i have chosen a test game so i can get used to scriping and how it works. If you like i could stop doin bots and start scriptin something else. but what? my aim is my own person base builder for age of empires. age of empires map changes so i have to use the colour selector thing (snippets) sy yh im startin from easy Edited by AngelOfMercy

Share this post


Link to post
Share on other sites
AngelOfMercy

ok not a problem :x ill go ask @ elitepvpers thanks anyways

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×