Post by worldgorger on Aug 30, 2012 1:48:18 GMT -5
So basically, I saw Travis's post on an ahk alternative for mac users, and figured id somewhat try to explain how to use ahk for windows users First off you'll wanna download ahk to do this just google ahk download. Once youve got that done open up a new notepad and paste this into it
once you've done that save the filename as whatever you wanna call it for me its "dgstart" then after that youll wanna put ".ahk" so in the end for me it was dgstart.ahk
go to the dropdown beside "save as type" and change to "all files" like this
once youve done that, save it to your desktop or some other place where you'll be able to find it and just select run script :> its setup so f6 trades smuggler and sells your item drops items (gt/pgt) and can also create pgt, f7 buys your feathers and selects imbue other runes on the runecrafting altar, and f8 buys 250 essence these button settings can be changed by rightclicking the save file and editing "f6" "f7" "f8" to any other key on your keyboard for example if you wanted to use your number pad instead youd change it to Numpad1, Numpad2, Numpad3 etc.
a full list of key names can be found here www.autohotkey.com/docs/KeyList.htm
dunno if ive done any good to help anyone but if i did then gz on being able to use ahk for faster starts
for some reason on vid looks like im trading smuggler and dropping pgt kinda slow when rly im not
Also i realize i left key under smuggler lol only went in floor to demonstrate ahk
credit to Don Draper for providing the scripting for it
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
F6:: ;~ 3 inputs.
Click_M(2, 1) ;~ Produces 3 actions.
Return
F7:: ;~ 3 inputs.
Click_M(5, 1) ;~ Produces 3 actions.
Return
F8:: ;~ 3 inputs.
Click_M(4, 1) ;~ Produces 3 actions.
Return
F9:: ;~ 3 inputs.
Click_M(3, 1) ;~ Produces 3 actions.
Return
/*
,------. ,---.,--. ,--.
| .-. \ ,---. / .-'`--',--,--, `--',--,--, ,---.
| | \ .-. `-,,--.| \,--.| \| .-. |
| '--' /\ --.| .-'| || || || || || |' '-' '.--..--..--.
`-------' `----'`--' `--'`--''--'`--'`--''--'.`- / '--''--''--'
`---'
*/
;~ Click - Click
;~ Click_I - Click Item
;~ Click_IN - Click_Item Numbers
;~ Click_M - Click Menu
;~ Click_MI - Click Menu Item
;~ Click_E - Click Equipped
;~ Click_ME - Click Equipped Menu
;~ Click_QP - Click Quick Prayer
;~ Click_C - Click Compass
;~ Click_S - Click Summoning
;~ Click_SI - Click Summoning Item
;~ Click_DCI - Click Deposit Carried Items
;~ Click_BI - Click Bank Item
;~ Click_BMI - Click Bank Menu Item
;~ Click_BC - Click Bank Close
;~ Click_T - Click Tab
;~ Click_AS - Click Attack Style
;~ Click_SA - Click Special Attack
/*
,------. ,--. ,--.
| .---',--.,--.,--,--, ,---.,-' '-.`--' ,---. ,--,--, ,---.
| `--, | || || \| .--''-. .-',--.| .-. || \( .-'
| |` ' '' '| || |\ `--. | | | |' '-' '| || |.-' `)
`--' `----' `--''--' `---' `--' `--' `---' `--''--'`----'
*/
/*
Click
Parameters: X - The X coordinate to click.
Y - The Y coordinate to click.
Ra - Amount of pixels to randomize the click by.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click(X, Y, Ra=0, R=0, S=0) {
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
CLICK_X:=X,CLICK_Y:=Y
If Ra
{
Random, CLICK_X, % CLICK_X-Ra, % CLICK_X+Ra
Random, CLICK_Y, % CLICK_Y-Ra, % CLICK_Y+Ra
}
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Item Numbers
Parameters: N - The item numbers in your inventory to click seperated by |.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_IN(N, R=0, S=0) {
StringSplit, N, N, |
If !N0
Return
If(N0==1)
If N1 is not Number
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=5)
{
Click_T(5, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
Loop, % N0
{
If N%A_Index% is Number
{
I_X:=RS_X+WIN_X+RS_W-179+Mod(N%A_Index%-1, 4)*42,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-295+Div(N%A_Index%-1, 4)*36):(RS_Y+WIN_Y+RS_H-332+Div(N%A_Index%-1, 4)*36),I_W:=35,I_H:=31
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
}
}
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Item
Parameters: N - The item number in your inventory to click.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_I(N, R=0, S=0) {
If N is not Number
Return
If(N<1||N>28)
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=5)
{
Click_T(5, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=RS_X+WIN_X+RS_W-179+Mod(N-1, 4)*42,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-295+Div(N-1, 4)*36):(RS_Y+WIN_Y+RS_H-332+Div(N-1, 4)*36),I_W:=35,I_H:=31
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Move Item
Parameters: N - The item number in your inventory to move the mouse to.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Move_I(N, S=0) {
If N is not Number
Return
If(N<1||N>28)
Return
If(N<1||N>11)
Return
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=RS_X+WIN_X+RS_W-161.5+Mod(N-1, 4)*42,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-279.5+Div(N-1, 4)*36):(RS_Y+WIN_Y+RS_H-316.5+Div(N-1, 4)*36)
If S
MouseMove_Ellipse("", "", I_X, I_Y, S, 1)
Else
{
SetMouseDelay, -1
MouseMove, % I_X, I_Y
}
SetMouseDelay, % D
}
/*
Click Tab
Parameters: T - The tab to be clicked. Name of the tab of #1-16.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_T(T, R=0, S=0) {
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
If T is Alpha
{
TL:="Combat Styles|Task System|Stats|Quest Journals|Inventory|Worn Equipment|Prayer List|Magic Spellbook||Friends List|Friends Chat|Clan Chat|Options|Emotes|Music Player|Notes"
StringSplit, TL, TL, |
Loop, % TL0
{
If TL%A_Index% contains %T%
{
T:=A_Index
Break
}
}
}
If T is not Number
Return 0
If(T<0||T>16)
Return 0
If(T==Active_T())
Return
T_X:=(RS_W>995) ? WIN_X+RS_X+RS_W-480+(T-1)*30:WIN_X+RS_X+RS_W-240+Mod(T-1, 8)*30, T_Y:=(RS_W>995) ? WIN_Y+RS_Y+RS_H-37:WIN_Y+RS_Y+RS_H-74+Div(T-1, 8)*37,T_W:=29,T_H:=36
Random, CLICK_X, % T_X, % T_X+T_W
Random, CLICK_Y, % T_Y, % T_Y+T_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Equipped
Parameters: N - The armor slot to be clicked. 1-11.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_E(N, R=0, S=0) {
If N is not Number
Return
If(N<1||N>11)
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=6)
{
Click_T(6, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
E_X:="116|157|116|75|172|116|60|116|172|116|60",E_Y:="334|295|295|295|256|256|256|216|176|176|176"
StringSplit, E_X, E_X, |
StringSplit, E_Y, E_Y, |
E_X:=WIN_X+RS_X+RS_W-E_X%N%,E_Y:=(RS_W>995) ? WIN_Y+RS_Y+RS_H-E_Y%N%+37:WIN_Y+RS_Y+RS_H-E_Y%N%,E_W:=33,E_H:=31
Random, CLICK_X, % E_X, % E_X+E_W
Random, CLICK_Y, % E_Y, % E_Y+E_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Menu Equipped
Parameters: N - The armor slot to be clicked. 1-11.
M - The menu item to be clicked.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_ME(N, M, R=0, S=0) {
If N is not Number
Return
If(N<1||N>11)
Return
If M is not Number
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=6)
{
Click_T(6, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
E_X:="116|157|116|75|172|116|60|116|172|116|60",E_Y:="334|295|295|295|256|256|256|216|176|176|176"
StringSplit, E_X, E_X, |
StringSplit, E_Y, E_Y, |
E_X:=WIN_X+RS_X+RS_W-E_X%N%,E_Y:=(RS_W>995) ? WIN_Y+RS_Y+RS_H-E_Y%N%+37:WIN_Y+RS_Y+RS_H-E_Y%N%,E_W:=33,E_H:=31
Random, CLICK_X, % E_X, % E_X+E_W
Random, CLICK_Y, % E_Y, % E_Y+E_H
Random, O_X, -50, 50
Random, O_Y, 0, 15
CLICK_X2:=CLICK_X+O_X,CLICK_Y2:=CLICK_Y+21+16*(M-1)+O_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click Right %CLICK_X%, %CLICK_Y%
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X2%, %CLICK_Y2%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y, 0
SetMouseDelay, % D
}
/*
Click Special Attack
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_SA(R=0, S=0) {
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=1)
{
Click_T(1, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=RS_X+WIN_X+RS_W-174,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-97):(RS_Y+WIN_Y+RS_H-135),I_W:=149,I_H:=25
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Summoning Item
Parameters: N - The summoning icon menu item to be clicked.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_SI(M, R=0, S=0) {
If M is not Number
Return
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
S_X:=WIN_X+RS_X+RS_W-180,S_Y:=WIN_Y+RS_Y+140,S_W:=56,S_H:=33
Random, CLICK_X, % S_X, % S_X+S_W
Random, CLICK_Y, % S_Y, % S_Y+S_H
Random, R_X, 0, 1
Random, O_X, 0, 50
Random, O_Y, 0, 15
CLICK_X2:=(!R_X) ? (CLICK_X-O_X):(CLICK_X+O_X), CLICK_Y2:=CLICK_Y+21+16*(M-1)+O_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click Right %CLICK_X%, %CLICK_Y%
If S
MouseMove_Ellipse("", "", CLICK_X2, CLICK_Y2, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X2%, %CLICK_Y2%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y, 0
SetMouseDelay, % D
}
/*
Click Summoning
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_S(R=0, S=0) {
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
S_X:=WIN_X+RS_X+RS_W-180,S_Y:=WIN_Y+RS_Y+140,S_W:=56,S_H:=33
Random, CLICK_X, % S_X, % S_X+S_W
Random, CLICK_Y, % S_Y, % S_Y+S_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Quick Prayer
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_QP(R=0, S=0) {
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
QP_X:=WIN_X+RS_X+RS_W-215,QP_Y:=WIN_Y+RS_Y+72,QP_W:=56,QP_H:=33
Random, CLICK_X, % QP_X, % QP_X+QP_W
Random, CLICK_Y, % QP_Y, % QP_Y+QP_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Make All
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_MA(R=0, S=0) {
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
MA_X := RS_X+WIN_X+221, MA_Y:= RS_Y+WIN_Y+RS_H-110,MA_W:= 75,MA_H:= 63
Random, R_X, 0, % MA_W
Random, R_Y, 0, % MA_H
CLICK_X:=MA_X+R_X,CLICK_Y:=MA_Y+R_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Deposit Caried Items
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_DCI(R=0, S=0) {
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
D_X:=(RS_W<960) ? WIN_X+RS_X+RS_W-360:WIN_X+RS_X+RS_W/2+119
D_Y:=WIN_X+RS_Y+RS_H-222
D_W:=34
D_H:=34
Random, CLICK_X, % D_X, % D_X+D_W
Random, CLICK_Y, % D_Y, % D_Y+D_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Bank Menu Item
Parameters: N - The bank item to click.
M - The menu item to click.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_BMI(N, M, R=0, S=0) {
If N is not Number
Return
If M is not Number
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=(RS_W<960) ? WIN_X+RS_X+RS_W-701+Mod(N-1, 10)*44:WIN_X+RS_X+RS_W/2-222+Mod(N-1, 10)*44,I_Y:=WIN_Y+RS_Y+98+Div(N-1, 10)*44,I_W:=35,I_H:=31
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
Random, R_X, 0, 1
Random, O_X, 0, 50
Random, O_Y, 0, 15
CLICK_X2:=(!R_X) ? (CLICK_X-O_X):(CLICK_X+O_X), CLICK_Y2:=CLICK_Y+21+16*(M-1)+O_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click Right %CLICK_X%, %CLICK_Y%
If S
MouseMove_Ellipse("", "", CLICK_X2, CLICK_Y2, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X2%, %CLICK_Y2%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y, 0
SetMouseDelay, % D
}
/*
Click Bank Item
Parameters: N - The bank item to click.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_BI(N, R=0, S=0) {
If N is not Number
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=(RS_W<960) ? WIN_X+RS_X+RS_W-701+Mod(N-1, 10)*44:WIN_X+RS_X+RS_W/2-222+Mod(N-1, 10)*44,I_Y:=WIN_Y+RS_Y+98+Div(N-1, 10)*44,I_W:=35,I_H:=31
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Bank Close
*/
Click_BC(R=0, S=0) {
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
C_X:=(RS_W<960) ? WIN_X+RS_X+RS_W-258:WIN_X+RS_X+RS_W/2+221
C_Y:=WIN_Y+RS_Y+33
C_W:=15
C_H:=15
Random, CLICK_X, % C_X, % C_X+C_W
Random, CLICK_Y, % C_Y, % C_Y+C_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Attack Style
Parameters: N - The attack style number to be clicked. 1-4.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_AS(N=1, R=0, S=0){
If N is not Number
Return
If(N<1||N>4)
Return
D:=A_MouseDelay
If R
MouseGetPos, X, Y
If(Active_T()!=1)
{
Click_T(1, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
CS_X:="175|91|175|91",CS_Y:="258|258|205|205",CS_W:=69,CS_H:=45
StringSplit, CS_X, CS_X, |
StringSplit, CS_Y, CS_Y, |
Random, CLICK_X, % WIN_X+RS_X+RS_W-CS_X%N%, WIN_X+RS_X+RS_W-CS_X%N%+CS_W
Random, CLICK_Y, % WIN_Y+RS_Y+RS_H-CS_Y%N%, WIN_Y+RS_Y+RS_H-CS_Y%N%+CS_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Compass
Parameters: R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_C(R=0, S=3) {
D:=A_MouseDelay
If R
MouseGetPos, X, Y
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
C_X:=WIN_X+RS_X+RS_W-167,C_Y:=WIN_Y+RS_Y+5,C_W:=32,C_H:=32
Random, CLICK_X, % C_X, % C_X+C_W
Random, CLICK_Y, % C_Y, % C_Y+C_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Menu
Parameters: N - The menu item number to click.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_M(N, R=0, S=0) {
If N is not Number
Return
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
MouseGetPos, X, Y
Click Right
Random, O_X, -50, 50
Random, O_Y, 0, 15
CLICK_X:=X+O_X, CLICK_Y:=Y+21+16*(N-1)+O_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Click Menu Iventory
Parameters: N - The inventory item to be right clicked.
M - The menu item to click.
R - Return the mouse to it's original position.
S - Speed of the mouse movements. 0 is instant.
*/
Click_MI(N, M, R=0, S=0) {
If N is not Number
Return
If(N<1||N>28)
Return
If M is not Number
Return
If R
MouseGetPos, X, Y
D:=A_MouseDelay
If(Active_T()!=5)
{
Click_T(5, 0, S)
Sleep (100)
}
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=RS_X+WIN_X+RS_W-179+Mod(N-1, 4)*42,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-295+Div(N-1, 4)*36):(RS_Y+WIN_Y+RS_H-332+Div(N-1, 4)*36),I_W:=35,I_H:=31
Random, CLICK_X, % I_X, % I_X+I_W
Random, CLICK_Y, % I_Y, % I_Y+I_H
Random, R_X, 0, 1
Random, O_X, 0, 50
Random, O_Y, 0, 15
CLICK_X2:=(!R_X) ? (CLICK_X-O_X):(CLICK_X+O_X), CLICK_Y2:=CLICK_Y+21+16*(M-1)+O_Y
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click Right %CLICK_X%, %CLICK_Y%
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X2%, %CLICK_Y2%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y, 0
SetMouseDelay, % D
}
/*
Click Click Here To Continue
Parameters: N - One of the two locations.
S - Speed of the mouse movements. 0 is instant.
*/
Click_CHTC(N, S=0) {
If R
MouseGetPos, X, Y
D:=A_MouseDelay
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
CHTC_X:=(N=1) ? RS_X+WIN_X+37:RS_X+WIN_X+131,CHTC_Y:=RS_Y+WIN_Y+RS_H-58,CHTC_W:=349,CHTC_H:=16
Random, CLICK_X, % CHTC_X, % CHTC_X+CHTC_W
Random, CLICK_Y, % CHTC_Y, % CHTC_Y+CHTC_H
If S
MouseMove_Ellipse("", "", CLICK_X, CLICK_Y, S, 1)
Else
SetMouseDelay, -1
Click %CLICK_X%, %CLICK_Y%
If R && S
MouseMove_Ellipse("", "", X, Y, S, 1)
If R && !S
MouseMove, % X, % Y
SetMouseDelay, % D
}
/*
Check Click Here To Continue Blue
Parameters: N - One of the two locations.
*/
Check_CHTC_Blue(N) {
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
CHTC_X:=(N=1) ? RS_X+WIN_X+139:RS_X+WIN_X+233,CHTC_Y:=RS_Y+WIN_Y+RS_H-48,CHTC_W:=349,CHTC_H:=16
PixelGetColor, C, % CHTC_X, % CHTC_Y
If (C==0xFF0000)
Return 1
Return 0
}
/*
Check Click Here To Continue White
Parameters: N - One of the two locations.
*/
Check_CHTC_White(N) {
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
CHTC_X:=(N=1) ? RS_X+WIN_X+139:RS_X+WIN_X+233,CHTC_Y:=RS_Y+WIN_Y+RS_H-48,CHTC_W:=349,CHTC_H:=16
PixelGetColor, C, % CHTC_X, % CHTC_Y
If (C==0xFFFFFF)
Return 1
Return 0
}
/*
Active Tab
*/
Active_T() {
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return 0
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
Loop, 16
{
T_X:=(RS_W>995) ? WIN_X+RS_X+RS_W-480+(A_Index-1)*30:WIN_X+RS_X+RS_W-240+Mod(A_Index-1, 8)*30, T_Y:=(RS_W>995) ? WIN_Y+RS_Y+RS_H-37:WIN_Y+RS_Y+RS_H-74+Div(A_Index-1, 8)*37,T_W:=29,T_H:=36
PixelGetColor, C_%A_Index%, % T_X, % T_Y+T_H/2
C_%A_Index%:=Hex2Dec(C_%A_Index%)
}
If(C_1==C_2&&C_2==C_3&&C_3==C_4&&C_4==C_5&&C_5==C_6&&C_6==C_7&&C_7==C_8&&C_8==C_9&&C_9==C_10&&C_10==C_11&&C_11==C_12&&C_ 12==C_13&&C_13==C_14&&C_14==C_15&&C_15==C_16)
Return 0
Loop, 16
If(C_%A_Index%>C_%H%)
H:=A_Index
Return H
}
/*
PixelGetColor Item
Parameters: N - The inventory item to get the central color of.
*/
PixelGetColor_I(N) {
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
I_X:=RS_X+WIN_X+RS_W-161.5+Mod(N-1, 4)*42,I_Y:=(RS_W>995) ? (RS_Y+WIN_Y+RS_H-279.5+Div(N-1, 4)*36):(RS_Y+WIN_Y+RS_H-316.5+Div(N-1, 4)*36)
PixelGetColor, C, % I_X, % I_Y
Return C
}
Find_RS() {
ControlGetPos, RS_X, RS_Y, RS_W, RS_H, SunAwtCanvas2, % "ahk_id " WinExist("A")
If(RS_X == "")
Return
WinGetPos, WIN_X, WIN_Y, WIN_W, WIN_H, % "ahk_id " WinExist("A")
MouseGetPos, X, Y
ToolTip, % "RuneScape:`nWidth - " RS_W "px`nHeight - " RS_H "px`n`nMouse distance from:`nLeft - " X-(WIN_X+RS_X) "px`nRight - " WIN_X+RS_X+RS_W-X "px`nTop - " Y-(WIN_Y+RS_Y) "px`nBottom - " WIN_Y+RS_Y+RS_H-Y "px"
}
Div(X, Y) {
Return Floor(X/Y)
}
Random(N, N2) {
Random, R, % N, % N2
Return R
}
/*
By: Wicked.
Name: MouseMove_Ellipse()
Description: Moves the mouse from (X1, Y1) to (X2, Y2) using an ellipse rather then a straight line.
Parameters: X1 - The beginning X coordinate. Leave blank to use the current mouse position.
Y2 - The beginning Y coordinate. Leave blank to use the current mouse position.
X2 - The second X coordinate.
Y2 - The second Y coordinate.
S - The speed. In this case, the larger the number, the faster the speed.
B - Blocks the mouse input. Set to 1 or true to block mouse input during the mouse movement.
I - Inverts the ellipse path.
Examples: MouseMove_Ellipse(50, 50, 300, 300) moves mouse from (50, 50) to (300, 300).
MouseMove_Ellipse("", "", 300, 300, 2) moves mouse from it's current position to (300, 300) with a speed of 2.
MouseMove_Ellipse(50, 50, 300, 300, 5, 1) moves mouse from (50, 50) to (300, 300) with a speed of 5 and blocks mouse input.
MouseMove_Ellipse(50, 50, 300, 300, 5, 1, 1) moves mouse from (50, 50) to (300, 300) with a speed of 5, blocks mouse input and inverts the path.
Credits: None - Lending a helping hand.
[VxE] - For his guide to the ternary operator.
*/
MouseMove_Ellipse(X1, Y1, X2, Y2, S=1, M=0, I="") {
MouseGetPos, X0, Y0
If(I="")
Random, I, 0, 1
X1 := (X1 != "") ? X1 : X0, Y1 := (Y1 != "") ? Y1 : Y0, B := Abs(X1-X2), A := Abs(Y1-Y2), H := (X1<X2) ? ((Y1<Y2) ? ((I=0) ? X1:X2)(I=0) ? X2:X1))(Y1<Y2) ? ((I=0) ? X2:X1)(I=0) ? X1:X2)), K := (Y1<Y2) ? ((X1<X2) ? ((I=0) ? Y2:Y1)(I=0) ? Y1:Y2))(X1<X2) ? ((I=0) ? Y1:Y2)(I=0) ? Y2:Y1)), D := A_MouseDelay
SetMouseDelay, 1
If(M)
BlockInput, Mouse
If(B > A)
Loop, % B / S
{
M := (X1 < X2) ? ((I=0) ? -1:1)(I=0) ? 1:-1), X := (X1 < X2) ? (X1+A_Index*S) : (X1-A_Index*S), Y := M*Sqrt(A**2*((X-H)**2/B**2-1)*-1)+K
MouseMove, %X%, %Y%, 0
}
Else
Loop, % A / S
{
M := (Y1 < Y2) ? ((I=0) ? 1:-1)(I=0) ? -1:1), Y := (Y1 < Y2) ? (Y1+A_Index*S) : (Y1-A_Index*S), X := M*Sqrt(B**2*(1-(Y-K)**2/A**2))+H
MouseMove, %X%, %Y%, 0
}
MouseMove, %X2%, %Y2%, 0
BlockInput, Off
SetMouseDelay, % D
}
Hex2Dec(N) {
X:=((SubStr(N,1,2)!="0x") ? "0x":"") N
if ! StrLen(X+0)
return n
I:=A_FormatInteger
SetFormat,Integer, D
X+=0
SetFormat,Integer, % I
Return X
}
numpad5::click
once you've done that save the filename as whatever you wanna call it for me its "dgstart" then after that youll wanna put ".ahk" so in the end for me it was dgstart.ahk
go to the dropdown beside "save as type" and change to "all files" like this
once youve done that, save it to your desktop or some other place where you'll be able to find it and just select run script :> its setup so f6 trades smuggler and sells your item drops items (gt/pgt) and can also create pgt, f7 buys your feathers and selects imbue other runes on the runecrafting altar, and f8 buys 250 essence these button settings can be changed by rightclicking the save file and editing "f6" "f7" "f8" to any other key on your keyboard for example if you wanted to use your number pad instead youd change it to Numpad1, Numpad2, Numpad3 etc.
a full list of key names can be found here www.autohotkey.com/docs/KeyList.htm
dunno if ive done any good to help anyone but if i did then gz on being able to use ahk for faster starts
for some reason on vid looks like im trading smuggler and dropping pgt kinda slow when rly im not
Also i realize i left key under smuggler lol only went in floor to demonstrate ahk
credit to Don Draper for providing the scripting for it