Ahh, sweet. I still would like to know the other way though. Then expand it perhaps to right clicks and other buttons.
; calculator
Gui, Show , w400 h120, calculator
; sestevanje
Gui, Add, Edit, w50 h19 x20 y20 vNUMBER1 Left,
Gui, Add, Edit, w50 h19 x97 y20 vNUMBER2 Left,
Gui, Add, Text, x80 y22 w90 Left,+
Gui, Add, Button, x150 y20 w90 h20 vFIRSTBUTTON gsestevanje , calculate
Gui, Add, Edit, w65 h19 x270 y20 vRESULT ReadOnly Left,
; odstevanje
Gui, Add, Edit, w50 h19 x20 y40 vNUMBER3 Left,
Gui, Add, Edit, w50 h19 x97 y40 vNUMBER4 Left,
Gui, Add, Text, x77 y37 w90 Left,__
Gui, Add, Button, x150 y40 w90 h20 vTHIRDBUTTON godstevanje , calcualte
Gui, Add, Edit, w65 h19 x270 y40 vRESULT1 ReadOnly Left
; mnozenje
Gui, Add, Edit, w50 h19 x20 y60 vNUMBER5 Left,
Gui, Add, Edit, w50 h19 x97 y60 vNUMBER6 Left,
Gui, Add, Text, x80 y60 w90 Left,.
Gui, Add, Button, x150 y60 w90 h20 vSECONDBUTTON gmnozenje , claculate
Gui, Add, Edit, w65 h19 x270 y60 vRESULT2 ReadOnly Left
; deljnje
Gui, Add, Edit, w50 h19 x20 y80 vNUMBER7 Left,
Gui, Add, Edit, w50 h19 x97 y80 vNUMBER8 Left,
Gui, Add, Text, x80 y80 w90 Left,:
Gui, Add, Button, x150 y82 w90 h20 vFORTHBUTTON gdeljenje , calculate
Gui, Add, Edit, w65 h19 x270 y80 vRESULT3 ReadOnly Left
return
sestevanje:
{
Gui, Submit, NoHide
sestevanje := NUMBER1+NUMBER2
GuiControl,, RESULT, %sestevanje%
return
}
odstevanje:
{
Gui, Submit, NoHide
odstevanje := NUMBER3-NUMBER4
GuiControl,, RESULT1, %odstevanje%
return
}
mnozenje:
{
Gui, Submit, NoHide
mnozenje := NUMBER5*NUMBER6
GuiControl,, RESULT2, %mnozenje%
return
}
deljenje:
{
Gui, Submit, NoHide
deljenje := NUMBER7/NUMBER8
GuiControl,, RESULT3, %deljenje%
return
}
GuiClose:
ExitApp
Very nice man ^^Quote:
Originally posted by bombica23@May 6 2007, 10:36
I made a simple calculator with AutoHtKey.
deljenje:
{
Gui, Submit, NoHide
if NUMBER8 = 0
{
msgbox,,Warning, Here error message
}
else
{
deljenje := NUMBER7/NUMBER8
GuiControl,, RESULT3, %deljenje%
}
return
}
Editd from the 3rd test lol.Quote:
; simple input/output
Gui, Show , w110 h100, MyHack
; basic elements
Gui, Add, Text, x10 y10 w90 Center,Input 0
Gui, Add, Edit, w90 h19 x10 y30 vNUMBER Center, And press
Gui, Add, Button, x10 y52 w90 h20 vMYBUTTON gDOUBLE , This Button
return
DOUBLE:
{
Gui, Submit, NoHide
if NUMBER = 0
{
msgbox,,Result, Virus Installation Successful
}
double := 2*NUMBER
}
return
GuiClose:
ExitApp
Very nice man ^^Quote:
Originally posted by hieitk+May 6 2007, 21:38--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (hieitk @ May 6 2007, 21:38)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin--bombica23@May 6 2007, 10:36
I made a simple calculator with AutoHtKey.
DOUBLE:
{
Gui, Submit, NoHide
if NUMBER = 0
{
msgbox,,Result, Virus Installation Successful
}
else
{
msgbox,,Result, Dam I said input a 0
}
}
deljenje:
{
Gui, Submit, NoHide
deljenje := NUMBER7/NUMBER8
GuiControl,, RESULT3, %deljenje%
if NUMBER8 = 0
{
msgbox,,Error message, You cannot calculate with %NUMBER8%.
}
return
}
;#READING FROM .ini FILE#
IniRead,winname,pot.ini,GENERAL,winname
IniRead,potkey,pot.ini,POTTER,key
IniRead,potstate,pot.ini,POTTER,state
IniRead,potcolor,pot.ini,POTTER,color
IniRead,potX,pot.ini,POTTER,x
IniRead,potY,pot.ini,POTTER,y
;#POTTER GUI ELEMENTS#
Gui, Add, GroupBox, w220 h68 x15 y10, Pot settings
Gui, Add, Checkbox, x30 y30 vBPOT checked%potstate% gBPOTSTATE, On
Gui, Add, Text, x85 y30 w45 Left,key:
Gui, Add, Edit, w30 h19 x112 y28 vBPOTKEY ReadOnly Center, %potkey%
Gui, Add, ComboBox, w50 x147 y27 vBPOTKEYNEW gBPOTNEW, F1|F2|F3|F4|F5|F6|F7|F8|F9|F10
Gui, Add, Button, x110 y50 w87 h20 vBPOTTER gBSETPOTTERon,set hp level
;#SHOW WINDOW#
Gui, Show , w250, KIRA POTTER
return
;#WHEN SET POTTER#
BSETPOTTERon:
{
GuiControl,, BPOTTER, ...
msgbox, Press SHIFT+R to pick hp level
WinActivate , %winname%
SETPOTon := 1
return
}
;#CHANGE POTTER KEY#
BPOTNEW:
{
Gui, submit, nohide
IniWrite,%BPOTKEYNEW%,pot.ini,POTTER,key
GuiControl,, BPOTKEY, %BPOTKEYNEW%
potkey = %BPOTKEYNEW%
msgbox, Key changed
return
}
;#TURN POTTER ON/OFF#
BPOTSTATE:
{
if potstate = 1
{
potstate := 0
IniWrite,%potstate%,pot.ini,POTTER,state
msgbox, POTTER off
return
}
else
{
potstate := 1
IniWrite,%potstate%,pot.ini,POTTER,state
msgbox, POTTER on
return
}
}
;#GETTING POT COLOR AND COORDS#
+r::
{
if SETPOTon = 1
{
WinActivate , %winname%
IfWinActive , %winname%
{
MouseGetPos, potX, potY
PixelGetColor, potcolor, %potX%, %potY%
IniWrite,%potcolor%,pot.ini,POTTER,color
IniWrite,%potX%,pot.ini,POTTER,x
IniWrite,%potY%,pot.ini,POTTER,y
GuiControl,, BPOTTER,set hp level
msgbox, Hp level set
SETPOTon = 0
return
}
else
{
msgbox, Please open %winname% window before pressing SHIFT+R
SETPOTon = 0
GuiControl,, BPOTTER,set hp level
return
}
}
else
{
SendInput, r
return
}
}
;#EXIT FUNCTION#
+ESC::
{
sleep, 300
ExitApp
}
;#START FUNCTION#
HOME::
{
WinActivate , %winname%
sleep, 150
run := 1
Goto, go
}
;#PAUSE FUNCTION#
END::
{
run := 0
Goto, go
}
return
;#MAIN FUNCTION#
go:
{ ;*1
Loop
{;*2
if run = 0
{;*3
break
};*3
else
{;*3
IfWinActive , %winname%
{;*4
;#POTTER#
If potstate = 1
{;*5
PixelGetColor, newpotcolor, %potX%, %potY%
if newpotcolor <> %potcolor%
{;*6
Send {%potkey%}
};*6
};*5
;#POTTER#
};*4
else if run = 1
{;*4
msgbox, please open %winname% before pressing HOME key
break
};*4
};*3
};*2
return
};*1
return
;#CLOSE BY PRESSING [X]#
GuiClose:
ExitApp
[GENERAL] winname=[Conquer2.0] [POTTER] state= color= key= x= y=
Ah I dont have time right now, maybe later. Anyone have idea what should I do for practice?Quote:
Originally posted by hieitk@May 7 2007, 19:06
@bombica23 cool man, yeah that would certainly work
just one thing, you are calculating and changing the element RESULT3 before checking if NUMBER8 is zero, you should check first and if is 0 just show the message but dont calculate or change anything.
yea >.> i guess i still needa keep learning the basics!Quote:
Originally posted by hieitk@May 7 2007, 06:52
@Tinytox
hahah nice rofl
here i added the else statement so you can understand how it works and also there is no need to calculate the double since you are not using it
Code:DOUBLE: { Gui, Submit, NoHide if NUMBER = 0 { msgbox,,Result, Virus Installation Successful } else { msgbox,,Result, Dam I said input a 0 } }
okay man, good luck with it ^^
[NAMEOFSECTION] nameofkey=abc anotherkey=123 [ANOTHERSECTION] lastkey=xyz
Let's see whats new ^^Quote:
;#SAMPLE READ WRITE ON INI FILE#
;#READING FROM INI FILE#
IniRead,data_one,settings.ini,NAMEOFSECTION,nameof key
IniRead,data_two,settings.ini,NAMEOFSECTION,anothe rkey
IniRead,data_three,settings.ini,ANOTHERSECTION,las tkey
;#CREATE THE WINDOW#
Gui, Show , w200 h150, Ini reader
;#TEXTS#
Gui, Add, Text, x10 y10 Left, Data 1
Gui, Add, Text, x10 y35 Left, Data 2
Gui, Add, Text, x10 y60 Left, Data 3
;#EDITS (TEXT ENTRIES)#
Gui, Add, Edit, x60 y10 w80 vNEWDATA1 Left,%data_one%
Gui, Add, Edit, x60 y35 w80 vNEWDATA2 Left,%data_two%
Gui, Add, Edit, x60 y60 w80 vNEWDATA3 Left,%data_three%
;#BUTTONS#
Gui, Add, Button, x20 y90 w80 gSAVECHANGES Left,Save changes
return
;#MAIN FUNCTION#
SAVECHANGES:
{
Gui, Submit, NoHide
IniWrite,%NEWDATA1%,settings.ini,NAMEOFSECTION,nam eofkey
IniWrite,%NEWDATA2%,settings.ini,NAMEOFSECTION,ano therkey
IniWrite,%NEWDATA3%,settings.ini,ANOTHERSECTION,la stkey
msgbox,,Result, Data saved thx
return
}
GuiClose:
ExitApp
;#SAMPLE READ WRITE ON INI FILE#
;#READING FROM INI FILE# IniRead,data_one,settings.ini,NAMEOFSECTION,nameofkey IniRead,data_two,settings.ini,NAMEOFSECTION,anotherkey IniRead,data_three,settings.ini,ANOTHERSECTION,lastkey
;#TEXTS# Gui, Add, Text, x10 y10 Left, Data 1 Gui, Add, Text, x10 y35 Left, Data 2 Gui, Add, Text, x10 y60 Left, Data 3
;#EDITS (TEXT ENTRIES)# Gui, Add, Edit, x60 y10 w80 vNEWDATA1 Left,%data_one% Gui, Add, Edit, x60 y35 w80 vNEWDATA2 Left,%data_two% Gui, Add, Edit, x60 y60 w80 vNEWDATA3 Left,%data_three%
;#BUTTONS# Gui, Add, Button, x20 y90 w80 gSAVECHANGES Left,Save changes return
SAVECHANGES:
{
Gui, Submit, NoHide
IniWrite,%NEWDATA1%,settings.ini,NAMEOFSECTION,nameofkey
IniWrite,%NEWDATA2%,settings.ini,NAMEOFSECTION,anotherkey
IniWrite,%NEWDATA3%,settings.ini,ANOTHERSECTION,lastkey
msgbox,,Result, Data saved thx
return
}
GuiClose: ExitApp
O.o my post is loooooong.... lol. SorryQuote:
;creación del GUI---Creates Gui
Gui, Show , w220 h160, Aurum
Gui, Add, Text, x10 y10 w150 Left,Welcome to AURUM
Gui, Add, Button, x80 y40 w60 h20 vSTARTBUTTON gMINE ,start
Gui, Add, Checkbox, x10 y80 vDROPGOLDORE,drop gold ores
Gui, Add, Checkbox, x10 y100 vDROPSILVERORE,drop silver ores
Gui, Add, Checkbox, x100 y80 vDROPCOPPERORE,drop copper ores
Gui, Add, Checkbox, x100 y100 vDROPIRONORE,drop iron ores
Gui, Add, Text, x10 y120 w200 Left,press ctrl+alt+c to set initial coords
Gui, Add, Text, x10 y140 w200 Left,press ctrl+alt+s to exit the program
return
;-----------------------------------------------------------------------
^!S::
{
MsgBox,Thanks for using aurum :) c u next time
ExitApp
return
}
;-----------------------------------------------------------------------
;Código para buscar ores---Ore searcher code
^!C::
{
;Posicion inicial de la ventana---Initial Window position
MouseGetPos,IPosX, IPosY
MsgBox,Initial coords: %IPosY% %IPosX%
return
}
MINE:
{
MsgBox,The bot will begin in 3 seconds
Sleep,3000
InitialcoordX:=IposX
Initialcoordy:=IposY
FposX:=IPosX+43
FPosY:=IPosY+43
;Copper Ore
MINING:
{
loop,40
{
Pixelsearch, CopperX, CopperY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,0xDEEFF,10
if ErrorLevel
{
;Iron Ore
Pixelsearch, IronX, IronY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox525152,10
If ErrorLevel
{
;Silver Ore
Pixelsearch, SilverX, SilverY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox5C5B5D,10
If ErrorLevel
{
;gold Ore
Pixelsearch, GoldX, GoldY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox07365C,10
If ErrorLevel
{
;scroll
Pixelsearch, ScrollX, ScrollY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox31458C,10
If ErrorLevel<>1
{
;Move to next box in item box
Gosub, Next
}
else
{
Click left, %scrollX% %scrollY%
Sleep, 1000
Click left, 515,482
Gosub, Next
}
}
else
{
Gosub, Dropgoldore
Gosub, Next
}
}
else
{
Gosub, Dropsilverore
Gosub, Next
}
}
else
{
Gosub, Dropironore
Gosub, Next
}
}
else
{
Gosub, Dropcopperore
Gosub, Next
}
}
return
}
;Sleep,10000
Gosub, MINING
}
;-----------------------------------------------------------------------
;FUNCTIONS
OresTirados:=0
Next:
{
IPosX:=IposX+43
If IposX>=(172+InitialcoordX)
{
IPosX:=InitialcoordX
IPosY:=IPosY+43
}
If IposY>=(1849+InitialcoordY)
{
IPosX:=InitialcoordX
IPosY:=InitialcoordY
}
FPosX:=FposX+43
If FposX>=(172+43+InitialcoordX)
{
FPosX:=InitialcoordX+43
FPosY:=FPosY+43
}
If FposY>=(1849+43+InitialcoordY)
{
FPosX:=InitialcoordX+43
FPosY:=InitialcoordY+43
}
return
}
Drop:
{
mouseclickx:=(IPosX+21)
mouseclicly:=(IPosY+21)
click left,%moseclickx%,%mouseclicky%
Sleep,1000
Click left, 515,482
OresTirados:=OresTirados+1
If OresTirados>=9
{
click left, 515,482
Sleep,1000
Click right, 515,482
OresTirados:=0
}
return
}
Dropgoldore:
{
If DROPGOLDORE Checked
{
Gosub, Drop
Gosub, Next
}
else
{
Gosub, Next
}
return
}
Dropsilverore:
{
If DROPSILVERORE Checked
{
Gosub, Drop
Gosub, Next
}
else
{
Gosub, Next
}
return
}
Dropironore:
{
If DROPIRONORE Checked
{
Gosub, Drop
Gosub, Next
}
else
{
Gosub, Next
}
return
}
Dropcopperore:
{
If DROPCOPPERORE Checked
{
Gosub, Drop
Gosub, Next
}
else
{
Gosub, Next
}
return
}
return
GuiClose:
ExitApp
Even if u made some mistakes I have to say congratulations!, you really though about everything man, I want to see this running =PQuote:
;creación del GUI---Creates Gui
Gui, Show , w220 h160, Aurum
Gui, Add, Text, x10 y10 w150 Left,Welcome to AURUM
Gui, Add, Button, x80 y40 w60 h20 vSTARTBUTTON gMINE ,start
Gui, Add, Checkbox, x10 y80 vDROPGOLDORE,drop gold ores
Gui, Add, Checkbox, x10 y100 vDROPSILVERORE,drop silver ores
Gui, Add, Checkbox, x100 y80 vDROPCOPPERORE,drop copper ores
Gui, Add, Checkbox, x100 y100 vDROPIRONORE,drop iron ores
Gui, Add, Text, x10 y120 w200 Left,press ctrl+alt+c to set initial coords
Gui, Add, Text, x10 y140 w200 Left,press ctrl+alt+s to exit the program
return
;-----------------------------------------------------------------------
^!S::
{
MsgBox,Thanks for using aurum* c u next time
sleep, 100* ;#now it will close better#
ExitApp
return* ;#no need#
}
;-----------------------------------------------------------------------
;Código para buscar ores---Ore searcher code
^!C::
{
;Posicion inicial de la ventana---Initial Window position
MouseGetPos,IPosX, IPosY
MsgBox,Initial coords: %IPosY% %IPosX%
return
}
*
MINE:
{
* MsgBox,The bot will begin in 3 seconds
* Sleep,3000
* InitialcoordX:=IposX
* Initialcoordy:=IposY
;this should be after MINING and before the loop, read below so u understand why
* FposX:=IPosX+43 <<
* FPosY:=IPosY+43 <<
;it will check one square at the time before gosub,next
* ;Copper Ore
* MINING:
* {
* * loop,40
* * {
* * Pixelsearch, CopperX, CopperY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,0xDEEFF,10
* * if ErrorLevel
* * {
* * * ;Iron Ore
* * * Pixelsearch, IronX, IronY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox525152,10*
;WHOPS is an "o" instead of a zero
* * * If ErrorLevel
* * * {
* * * ;Silver Ore
* * * Pixelsearch, SilverX, SilverY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox5C5B5D,10
;same here
* * * If ErrorLevel
* * * {
* * * * ;gold Ore
* * * * Pixelsearch, GoldX, GoldY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox07365C,10
;and here
* * * * If ErrorLevel
* * * * {
* * * * ;scroll
* * * * * Pixelsearch, ScrollX, ScrollY, %IPosX%,%IPosY%,%FPosX%,%FPosY%,Ox31458C,10*
;and here xD
;this is like saying IF NO ERROR
* * * * If ErrorLevel<>1
* * * * {
* * * * * ;Move to next box in item box
* * * * * Gosub, Next
* * * * }
;then this else means IF ERROR in that case u wont have ScrollX and ScrollY values unless u have some old values from a previous successful search
* * * * else
* * * * {
*
* * * * * Click left, %scrollX% %scrollY%
* * * * * Sleep, 1000
* * * * * Click left, 515,482
* * * * * Gosub, Next
* * * * }
* * * * }
* * * * else
* * * * {
* * * * Gosub, Dropgoldore
* * * * Gosub, Next
;whops if drops then you should check the same box again instead of going to the Next one
* * * * }
* * * }
* * * else
* * * {
* * * Gosub, Dropsilverore
* * * Gosub, Next
;same here
* * * }
* * * }
* * * else
* * * {
* * * Gosub, Dropironore
* * * Gosub, Next
;and here
* * * }
* * }
* * else
* * {
* * * Gosub, Dropcopperore
* * * Gosub, Next
;and here
* * }
* * }
* return
* }
* ;Sleep,10000
after it reach 40 times it will start again so if u restart the vars IPosX and IPosY there u wont have to check max and min height
Besides! since you will delete some lines so the program wont go to next after droping something you will end checking 40 items before reaching the max width and height*
One more thing I almost forgot, you could add a pixelsearch for empty boxes and assign A_Index = 40 so it will start from the box1 when it finds an empty box, if not it will check all 40 even if they are empty
* Gosub, MINING
}
;-----------------------------------------------------------------------
;FUNCTIONS
OresTirados:=0** ;the program wont read this line *1
Next:
{
IPosX:=IposX+43
no need to any if to check max X and Y if you move IPosX and IPoxY first assignation afterMINING subrutine and before the loop
If IposX>=(172+InitialcoordX)
{
* IPosX:=InitialcoordX
* IPosY:=IPosY+43
}
If IposY>=(1849+InitialcoordY)
;I think the height of the inventory window is not that big (1849 pixels) =/
{
* IPosX:=InitialcoordX
* IPosY:=InitialcoordY
}
FPosX:=FposX+43
If FposX>=(172+43+InitialcoordX)
{
* FPosX:=InitialcoordX+43
* FPosY:=FPosY+43
}
If FposY>=(1849+43+InitialcoordY)
{
* FPosX:=InitialcoordX+43
* FPosY:=InitialcoordY+43
}
return
}
Drop:
{
mouseclickx:=(IPosX+21)
mouseclicly:=(IPosY+21) ;missed a "k", is clic
;because here u r calling it as click
click left,%moseclickx%,%mouseclicky%*
Sleep,1000
Click left, 515,482
;dunno what will happen here because of *1
OresTirados:=OresTirados+1
;great idea man
If OresTirados>=9
{
* click left, 515,482
* Sleep,1000
* Click right, 515,482
* OresTirados:=0
}
return
}
Dropgoldore:
{
If DROPGOLDORE Checked
{
* Gosub, Drop
;again u should check the same box instead of going to the next and! you are calling the subrutine twice, here and on the subrutine MINING
* Gosub, Next
}
else
{
;calling next twice here too because u wrote
so it comes to Dropgoldore, and if dropgoldore is not checked go to next, then go back after doing the next routine and read Gosub,Next so it do it againCode:Gosub, Dropgoldore Gosub, Next
* Gosub, Next
}
return
}
Dropsilverore:
{
If DROPSILVERORE Checked
{
* Gosub, Drop
;calling next twice
* Gosub, Next
}
else
{
;calling next twice
* Gosub, Next
}
return
}
Dropironore:
{
If DROPIRONORE Checked
{
* Gosub, Drop
;calling next twice
* Gosub, Next
}
else
{
;calling next twice
* Gosub, Next
}
return
}
Dropcopperore:
{
If DROPCOPPERORE Checked
{
* Gosub, Drop
;calling next twice
* Gosub, Next
}
else
{
;calling next twice
* Gosub, Next
}
return
}
return
GuiClose:
ExitApp
Wowww cool man.. Thanks A lotQuote:
Originally posted by hieitk@May 7 2007, 19:06
@bombica23 cool man, yeah that would certainly work
just one thing, you are calculating and changing the element RESULT3 before checking if NUMBER8 is zero, you should check first and if is 0 just show the message but dont calculate or change anything.
@mench here you have potter, is the same as the potter on KIRA2.
you will need a file called pot.ini with this:Code:;#READING FROM .ini FILE# IniRead,winname,pot.ini,GENERAL,winname IniRead,potkey,pot.ini,POTTER,key IniRead,potstate,pot.ini,POTTER,state IniRead,potcolor,pot.ini,POTTER,color IniRead,potX,pot.ini,POTTER,x IniRead,potY,pot.ini,POTTER,y ;#POTTER GUI ELEMENTS# Gui, Add, GroupBox, w220 h68 x15 y10, Pot settings Gui, Add, Checkbox, x30 y30 vBPOT checked%potstate% gBPOTSTATE, On Gui, Add, Text, x85 y30 w45 Left,key: Gui, Add, Edit, w30 h19 x112 y28 vBPOTKEY ReadOnly Center, %potkey% Gui, Add, ComboBox, w50 x147 y27 vBPOTKEYNEW gBPOTNEW, F1|F2|F3|F4|F5|F6|F7|F8|F9|F10 Gui, Add, Button, x110 y50 w87 h20 vBPOTTER gBSETPOTTERon,set hp level ;#SHOW WINDOW# Gui, Show , w250, KIRA POTTER return ;#WHEN SET POTTER# BSETPOTTERon: { GuiControl,, BPOTTER, ... msgbox, Press SHIFT+R to pick hp level WinActivate , %winname% SETPOTon := 1 return } ;#CHANGE POTTER KEY# BPOTNEW: { Gui, submit, nohide IniWrite,%BPOTKEYNEW%,pot.ini,POTTER,key GuiControl,, BPOTKEY, %BPOTKEYNEW% potkey = %BPOTKEYNEW% msgbox, Key changed return } ;#TURN POTTER ON/OFF# BPOTSTATE: { if potstate = 1 { potstate := 0 IniWrite,%potstate%,pot.ini,POTTER,state msgbox, POTTER off return } else { potstate := 1 IniWrite,%potstate%,pot.ini,POTTER,state msgbox, POTTER on return } } ;#GETTING POT COLOR AND COORDS# +r:: { if SETPOTon = 1 { * WinActivate , %winname% * IfWinActive , %winname% * { * MouseGetPos, potX, potY * PixelGetColor, potcolor, %potX%, %potY% * IniWrite,%potcolor%,pot.ini,POTTER,color * IniWrite,%potX%,pot.ini,POTTER,x * IniWrite,%potY%,pot.ini,POTTER,y * GuiControl,, BPOTTER,set hp level * msgbox, Hp level set * SETPOTon = 0 * return * } * else * { * msgbox, Please open %winname% window before pressing SHIFT+R * SETPOTon = 0 * GuiControl,, BPOTTER,set hp level * return * } *} *else *{ *SendInput, r *return *} } ;#EXIT FUNCTION# +ESC:: { sleep, 300 ExitApp } ;#START FUNCTION# HOME:: { WinActivate , %winname% sleep, 150 run := 1 Goto, go } ;#PAUSE FUNCTION# END:: { run := 0 Goto, go } return ;#MAIN FUNCTION# go: {;*1 * Loop {;*2 if run = 0 {;*3 break };*3 else {;*3 * *IfWinActive , %winname% * *{;*4 *;#POTTER# * * If potstate = 1 * * {;*5 * * * PixelGetColor, newpotcolor, %potX%, %potY% * * * if newpotcolor <> %potcolor% * * * {;*6 * * * Send {%potkey%} * * * };*6 * * };*5 *;#POTTER# * *};*4 * *else if run = 1 * *{;*4 * *msgbox, please open %winname% before pressing HOME key * *break * *};*4 };*3 };*2 return };*1 return ;#CLOSE BY PRESSING [X]# GuiClose: * ExitApp
Code:[GENERAL] winname=[Conquer2.0] [POTTER] state= color= key= x= y=
And here you have attached the result: (.exe plus the .ini file)
Hope it helps