taultunleashed logoMy first Macro and its only OK..looking to advance it a bit. : EverQuest 2 Premium Discussions
newtopic  postreply
 [ 2 posts ] 
blue large dot

My first Macro and its only OK..looking to advance it a bit. : EverQuest 2 Premium Discussions

Posted: January 30th, 2006, 1:51 pm
 
nosnemi
nosnemi's Reps:
User avatar
Wrote a bsaic script that only spams keys on a timed basis depending on how long the spell takes to cast ect ect ect. Then a sleep mode inbetween cycles before the next auto pull.

Works great until I get two mobs and my health gets depleted and it pulls again before health regens. My script is purely active and Im looking to advance my skills to make it reactive.

I have a little understanding but Im still a noob but any help would be appreciated.

I want to know how to get a script to react with my health meter in EQ2. I use ACtools and I have my rezolution set to 1024 x 768 ( actools optimum perfromance resolution?) I have a hadnful of applications taht can pinpoint X,Y pixel locations on the monitor and I'm operating in windowed mode. So all that being said.....

Whats next how do I use the X,Y pixel locations and color to interact with teh script. Im having a hard time wrapping my head around the idea that a script can detect pixel location and color definiton , ie: if green blah blah blah.

Can someone give me a bare bones script with a brief description so i can toy around with it. Maybe give me some ideas for the constants and how I would use them in a short script.



If i get it to work I'll make a post for us lesser experienced ppl on how to get started in the world of scripting. Kinda like a basic tutorial for the clueless before they try and run exhume and have no clue why it doesnt work and end up bothering all u programming gods. My posts could be a buffer between the ignorant and the godlike. I could continue to build my script from the noob level to semi experinced all in these forums so anyone could pick up on the learning stages I've already gone through using my mistakes and Ideas to help thoise who help tehmselves.


Reply with quote
Posted: January 30th, 2006, 6:49 pm
 
Tault_w118cmh

Total Posts: 17
Joined: November 23rd, 2004, 3:38 pm
Tault_w118cmh's Reps: 0
User avatar
premium
Howdy!

Don't feel bad, we were all newbies at one point or another. I'm by no means an expert, but I can get around with AutoIT pretty well.

Although the coding might be different, the general principals still remain for scripting languages such as Auto it and ACtools.

First, if you want to make your program more "reactive", then your going to be pulling alot more information from the screen, much more of the time. So my first piece of advice is to make sure that you have your program broken up into manageable function calls to try to make everything run smoothly.

Attached to this is very QUICKLY written GUI application in AutoIT3 to help you get started. I originally had a regular script started, but wanted to try my hand at GUI stuff.

THIS IS NOT FULLY FUNCTIONAL! Not even close :0) The aggro color checkmarks do not work, it has a terrible combat system, dosen't loot, and dosen't move. It will, however, turn in a circl and kill monsters if they are in your pull range (movement to target is next if I ever get time to put a few lines in :0)

To run, make sure Attack is in slot one, and follow the directions on the GUI. It's kinda hard to understand, but here is a quick summary..

To set color information, press f2 when your mouse is over your health (AS CLOSE TO FULL AS POSSIBLE), F3 when your over the monsters health (THIS MUST BE ON THE LEFT HAND SIDE! AS CLOSE TO DEATH AS POSSIBLE), and press F5 on the gold border outline that a monster has around his name. After these points are set, YOU MUST CLICK SET AND TEST BUTTON FOR EACH ONE!

In the EQ window input box, you must have the exact window name (don't worry, you can save this later).

Just click the save button to save your settings, then load them back up the next time.

Anyway, I don't expect you to get this running, because its more of an outline for me anyway, but I hope it helps.

(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
#include <GuiConstants.au3>
Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Closeclicked")
Opt("WinTitleMatchMode", 2)



;GUI Information
GuiCreate("EQ2 CWBOt Version 0.00000001", 450, 500)
GUISetState()  ; display the GUI
HotkeySet("{F2}", "Playerinfo1")
HOtkeyset("{F3}", "MobInfo1")
Hotkeyset("{F5}", "Moblevel")


;Variables
DIM $Playerhealthcolor
DIM $Mobhealthlevel
DIM $mobborder


;Input Box for Window Name
$windowname = GUICtrlCreateInput("", 135, 408, 300, 20)
GUICtrlCreatelabel("EQ2 Window Name", 20, 410, 110, 70)


; Buttons
$StartID  = GUICtrlCreateButton("Start", 30, 460, 50)
GUICtrlSetOnEvent(-1, "Mainloop")

$ExitID = GUICtrlCreateButton("Exit", 350, 460, 50)
GUICtrlSetOnEvent(-1, "Closeclicked")

$SaveID = GUICtrlCreateButton("Save", 110, 460, 50)
GUICtrlSetOnEvent(-1, "Save")

$loadID = GUICtrlCreateButton("Load", 190, 460, 50)
GUICtrlSetOnEvent(-1, "Load")


$resetID = GUICtrlCreateButton("Reset", 270, 460, 50)
GUICtrlSetOnEvent(-1, "Reset")





; Combat Key Menu
GUICtrlCreateLabel("Action Buttons", 25, 30)

GuiCtrlCreateLabel("Pull key 2", 10, 60, 90, 70)

GUICtrlCreateLabel("HO Start Key 3", 10, 90, 90, 70)

GUICtrlCreateLabel("Advance HO Key 4", 10, 120, 110, 70)

GUICtrlCreateLabel("Finish HO Key 5", 10, 150, 90, 70)

GUICtrlCreateLabel("Heal Key 6", 10, 180, 90, 70)


; Aggro Menu
GUICtrlCreateLabel("Aggro LVL Range", 270, 30)
$Greyaggro = GUICtrlCreateCheckbox (" Grey Mobs", 275, 55, 120, 20)
$Greenaggro = GUICtrlCreateCheckbox (" Green Mobs", 275, 80, 120, 20)
$Blueaggro = GUICtrlCreateCheckbox (" Blue Mobs", 275, 110, 120, 20)
$Whiteaggro = GUICtrlCreateCheckbox (" White Mobs", 275, 140, 120, 20)
$Orangeaggro = GUICtrlCreateCheckbox (" Orange Mobs", 275, 170, 120, 20)
$Redaggro = GUICtrlCreateCheckbox (" Red Mobs", 275, 200, 120, 20)



;Setting the Health Information
GUICtrlCreateLabel("Set Player Info", 25, 235)
GUICtrlCreateLabel("F2 To Set Point", 10, 250)
$playerhealthlabel0x = GUICtrlCreateLabel ("0", 35, 305, 40, 40)
$Playerhealthlabel0y = GUICtrlCreatelabel ("0", 75, 305, 40, 40)
$playerhealthbutton0 = GUICtrlCreateButton ("Test and Set Color", 10, 270, 110, 30)
GUICtrlSetOnEvent(-1, "playerColortest")

;Setting Mob Info
GUICtrlCreateLabel("Set Mob Health", 170, 235)
GUICtrlCreateLabel("F3 to Set Point Near 0%", 150, 250)
$mobhealthlabelx = GUICtrlCreatelabel("0", 180, 305, 40, 40)
$mobhealthlabely = GUICtrlCreatelabel("0", 220, 305, 40, 40)
$mobhealthbestbutton = GUICtrlCreateButton ("Test and Set Color", 155, 270, 110, 30)
GUICtrlSetOnEvent(-1, "mobhealthcolortest")


;Setting Mob Level
GUICtrlCreatelabel("Set Monster Gold Border Color", 290, 235, 150)
GUICtrlCreateLabel("F5 to Set Border Color", 300, 250)
$mobborderx = GUICtrlCreatelabel("0", 330, 305, 40, 40)
$mobbordery = GUICtrlCreatelabel("0", 360, 305, 40, 40)
$mobhealthbestbutton = GUICtrlCreateButton ("Test and Set Color", 295, 270, 110, 30)
GUICtrlSetOnEvent(-1, "moblevelcolortest")









GUISetState()  ; display the GUI


While 1
    $msg = GUIGetMsg()
   
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend




;--------------------------------------------------------------------------------------------


Func Playerinfo1()

   $a = MouseGetPos()
   GUIctrlSetData($playerhealthlabel0x, $a[0])
   GUIctrlSetData($playerhealthlabel0y, $a[1])
   
EndFunc

;--------------------------------------------------------------------------------------------



;--------------------------------------------------------------------------------------------

Func mobinfo1()

   $a = MouseGetPos()
   GUIctrlSetData($mobhealthlabelx, $a[0])
   GUIctrlSetData($mobhealthlabely, $a[1])
   
EndFunc


;----------------------------------------------------------------------------------------------


Func mobhealthColorTest()
   
   
   $userpointx = GUICtrlRead($mobhealthlabelx)
   $userpointy = GUICtrlRead($mobhealthlabely)
   $var = Pixelgetcolor($userpointx, $userpointy)
   MsgBox(0,"The Color at the point selected is ", $var)
   MsgBox(0,"Test Color", "You have successfully set your mob border color. If you recived a 0 as the color selected, please try again. Remember, there is no specific color code, just make sure it is not 0" )
   $mobhealthlevel = $var
Endfunc



;--------------------------------------------------------------------------------------------



Func Moblevelcolortest()

   $userpointx = GUICtrlRead($mobborderx)
   $userpointy = GUICtrlRead($mobbordery)
   $var = Pixelgetcolor($userpointx, $userpointy)
   MsgBox(0,"The Color at the point selected is ", $var)
   MsgBox(0,"Test Color", "You have successfully set your mob border color. If you recived a 0 as the color selected, please try again. Remember, there is no specific color code, just make sure it is not 0" )
   $mobborder = $var

Endfunc



;----------------------------------------------------------------------------------------------



Func moblevel()

   $a = MouseGetPos()
   GUIctrlSetData($mobborderx, $a[0])
   GUIctrlSetData($mobbordery, $a[1])
   
EndFunc





;----------------------------------------------------------------------------------------------


Func PlayerColorTest()
   
   
   $userpointx = GUICtrlRead($playerhealthlabel0x)
   $userpointy = GUICtrlRead($playerhealthlabel0y)
   $var = Pixelgetcolor($userpointx, $userpointy)
   MsgBox(0,"The Color at the point selected is ", $var)
   MsgBox(0,"Test Color", "You have successfully set your mob border color. If you recived a 0 as the color selected, please try again. Remember, there is no specific color code, just make sure it is not 0")
   $Playerhealthcolor = $var

Endfunc


;----------------------------------------------------------------------------------------------


Func CLOSEClicked()
Exit
EndFunc


;----------------------------------------------------------------------------------------------

Func CheckPlayerHealth()
   
   $userpointx = GUICtrlRead($playerhealthlabel0x)
   $userpointy = GUICtrlRead($playerhealthlabel0y)
   $var = Pixelgetcolor($userpointx, $userpointy)   
   DO
      SEND ("{F1}")
      SLEEP (1000)
      $var = Pixelgetcolor($userpointx, $userpointy)
      
      $userpointx2 = GUICtrlRead($mobhealthlabelx)
      $userpointy2 = GUICtrlRead($mobhealthlabely)
      $var2 = Pixelgetcolor($userpointx2, $userpointy2)

      IF $Var2 = $mobhealthlevel Then
      Combat()
      Endif


   Until $Var = $Playerhealthcolor
   send("{ESC}")

Endfunc
   
;------------------------------------------------------------------
   
FUNC Scanformob()

   
      DO
      Send ("{LEFT Down}")
      Sleep (500)
      Send ("{LEFT Up}")
      SEND ("{Tab}")
      $userpointx = GUICtrlRead($mobhealthlabelx)
      $userpointy = GUICtrlRead($mobhealthlabely)
      $var = Pixelgetcolor($userpointx, $userpointy)
      Sleep (2000)
      
      
      Until $var = $mobhealthlevel


ENDFunc
   
;-------------------------------------------------------------

FUNC Mainloop()
   $x = 1
   Do
   WinActivate (GUICtrlread($windowname), "")
   Checkplayerhealth()
   Scanformob()
   Combat()
   Until $x = 0
Endfunc

;-------------------------------------------------------------

FUNC Combat()

   $userpointx = GUICtrlRead($mobhealthlabelx)
   $userpointy = GUICtrlRead($mobhealthlabely)
   $var = Pixelgetcolor($userpointx, $userpointy)
   $mobborderx = GUICtrlRead($mobborderx)
   $mobbordery = GUICtrlRead($mobbordery)
   $var2 = Pixelgetcolor($mobborderx, $mobbordery)
   $movecounter = 0

   IF $var2 = $mobborder THEN   
   Do
   Send("{1}")
   sleep(1000)      
   Send("{2}")
   DO   
   Sleep (2000)
   Send("{3}")
   sleep (2000)
   Send("{4}")
   sleep (2000)
   Send("{5}")
   $var = Pixelgetcolor($userpointx, $userpointy)
   Until $var < 10000
   Sleep (4000)
   $var = Pixelgetcolor($userpointx, $userpointy)
   Until $var < 10000
   Endif
Endfunc


;---------------------------------------------------------------

Func Save()

IniWrite ( "c:\cwconfig.ini", "labels", "playerhealthlabel0x", GUICtrlRead($playerhealthlabel0x) )
IniWrite ( "c:\cwconfig.ini", "labels", "playerhealthlabel0y", GUICtrlRead($playerhealthlabel0y) )
IniWrite ( "c:\cwconfig.ini", "labels", "mobhealthlabelx", GUICtrlRead($mobhealthlabelx) )
IniWrite ( "c:\cwconfig.ini", "labels", "mobhealthlabely", GUICtrlRead($mobhealthlabely) )
IniWrite ( "c:\cwconfig.ini", "labels", "moblevely", GUICtrlRead($mobbordery) )
IniWrite ( "c:\cwconfig.ini", "labels", "moblevelx", GUICtrlRead($mobborderx) )
Iniwrite ( "c:\cwconfig.ini", "Eqfilename", "eqwindowname", GUICtrlRead($windowname))
Iniwrite ( "c:\cwconfig.ini", "Eqfilename", "playerhealthcolor",$playerhealthcolor )
Iniwrite ( "c:\cwconfig.ini", "Eqfilename", "mobbordercolor", $mobborder)
Iniwrite ( "c:\cwconfig.ini", "Eqfilename", "mobhealthlevel", $mobhealthlevel)



Endfunc

;------------------------------------------------------------------

Func Load()

GUICtrlSetData($playerhealthlabel0x, IniRead ("c:\cwconfig.ini", "labels", "playerhealthlabel0x", "0"))
GUICtrlSetData($playerhealthlabel0y, IniRead ("c:\cwconfig.ini", "labels", "playerhealthlabel0y", "0"))
GUICtrlSetData($mobhealthlabelx, IniRead ("c:\cwconfig.ini", "labels", "mobhealthlabelx", "0"))
GUICtrlSetData($mobhealthlabely, IniRead ("c:\cwconfig.ini", "labels", "mobhealthlabely", "0"))
GUICtrlSetData($mobborderx, IniRead ("c:\cwconfig.ini", "labels", "moblevelx", "0"))
GUICtrlSetData($mobbordery, IniRead ("c:\cwconfig.ini", "labels", "moblevely", "0"))
GUICtrlSetData($windowname, IniRead ("c:\cwconfig.ini", "eqfilename", "eqwindowname", ""))
$playerhealthcolor = IniRead ("c:\cwconfig.ini", "eqfilename", "playerhealthcolor", "0")
$mobborder = IniRead ("c:\cwconfig.ini", "eqfilename", "mobbordercolor", "0")
$mobhealthlevel = IniRead ("c:\cwconfig.ini", "eqfilename", "mobhealthcolor", "0")

Endfunc

;-------------------------------------------------------------------

Func Reset()


GUICtrlSetData($playerhealthlabel0x, "0")
GUICtrlSetData($playerhealthlabel0y, "0")
GUICtrlSetData($mobhealthlabelx, "0")
GUICtrlSetData($mobhealthlabely, "0")
GUICtrlSetData($mobborderx, "0")
GUICtrlSetData($mobbordery, "0")
GUICtrlSetData($windowname, "")

Endfunc

;-------------------------------------------------------------------





Reply with quote
Want Advertisements After The Last Post Removed? Create A Free Account!

blue large dot Who is online
Users browsing this forum: No registered users and 91 guests

Popular Sections
SWTOR Cheats
Guild Wars 2 Cheats
Guild Wars 2 Hacks
Guild Wars 2 Bots
Diablo 3 Cheats
Guild Wars 2 Mods

Popular Sections
WoW Cataclysm Cheats & Exploits
WoW Cataclysm Hacks & Bots
Star Wars The Old Republic Cheats
SWTOR Mods
Torchlight 2 Cheats
SWTOR Space Mission Bots
Site Nav and RSS
RSS Feed of EverQuest 2 Premium Discussions RSS Feed 
Sitemap of EverQuest 2 Premium Discussions Sitemap 
SitemapIndex SitemapIndex
RSS Feed RSS Feed
Channel list Channel list
left bottom corner Site and Contents Copyright 2001-2012 All Rights Reserved TaultUnleashed.com bottom corner
top left
top right
createaccount
Username:   Password:   Remember Me?