Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RuneScape Gear Switch


  • Please log in to reply
8 replies to this topic
Wicked
  • Members
  • 504 posts
  • Last active: Nov 02 2017 11:07 PM
  • Joined: 07 Jun 2008
Well, this script is for those that play RuneScape. It's a script that I've been using. You can see it in action here and here. It can also be used for PKing... A lot use it for that.

This script is one that I've always used for Tormented Demons... It's got me 56 Dragon Claws in under 3 months. =).

It will only work using Jagex's client... In re-sizable. Could change it, but it's what I use so I found no need.

To make it click the inventory slots you want, change Item_Numbers in the tilde hotkey.

#Persistent

CoordMode, Mouse, Screen
SetBatchLines, -1
SetMouseDelay, 0
SetTitleMatchMode, 3
SetWinDelay, -1
Box_Init("00FF00")
Inventory_Width := 200
Inventory_Height := 270
SysGet, Window_Border, 32, 33
WinGet, RuneScape_ID, ID, RuneScape
If (RuneScape_ID == "")
   ExitApp
WinGet, RuneScape_PID, PID, % "ahk_id " RuneScape_ID
Process, Exist, JagexLauncher.exe
If (ErrorLevel == 0 || (RuneScape_PID != ErrorLevel))
   ExitApp
SetTimer, Locate_Inventory, 0
Return

Locate_Inventory:
IfWinNotActive, % "ahk_id " RuneScape_ID
{
   Box_Hide()
   Return
}
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
If(RuneScape_Width < 775 || RuneScape_Height-Window_Border*2 < 566)
{
   Box_Hide()
   Return
}
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
Box_Draw(Inventory_X, Inventory_Y, 199, 270)
Return

`::
IfWinNotActive, % "ahk_id " RuneScape_ID
   Return
SetTimer, Locate_Inventory, Off
Item_Numbers = 1|5|9|13|17|21 ;CHANGE THIS TO DESIRED 
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
MouseGetPos, Mouse_X, Mouse_Y
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
;~ Inventory_X2 := Inventory_X+199
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
;~ Inventory_Y2 := Inventory_Y+270
First_Item_X := Inventory_X+38.5
First_Item_Y := Inventory_Y+28.5
StringSplit, Item_Numbers, Item_Numbers, |
Loop, % Item_Numbers0
{
	Item_X := First_Item_X+Mod(Item_Numbers%A_Index%-1, 4)*42
	Item_Y := First_Item_Y+Div(Item_Numbers%A_Index%-1, 4)*36
	MouseMove, % Item_X, % Item_Y
	Click
}
MouseMove, % Mouse_X, % Mouse_Y
SetTimer, Locate_Inventory, 0
Return

Div(X, Y) {
	Return Floor(X/Y)	
}

Box_Init(C="FF0000") {
   Gui, 96: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 96: Color, % C
   Gui, 97: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 97: Color, % C
   Gui, 98: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 98: Color, % C
   Gui, 99: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 99: Color, % C
}

Box_Draw(X, Y, W, H, T="1", O="I") {
   If(W < 0)
      X += W, W *= -1
   If(H < 0)
      Y += H, H *= -1
   If(T >= 2)
   {
      If(O == "O")
         X -= T, Y -= T, W += T, H += T
      If(O == "C")
         X -= T / 2, Y -= T / 2
      If(O == "I")
         W -= T, H -= T
   }
   Gui, 96: Show, % "x" X " y" Y " w" W " h" T " NA", Horizontal 1
   Gui, 98: Show, % "x" X " y" Y + H " w" W " h" T " NA", Horizontal 2
   Gui, 97: Show, % "x" X " y" Y " w" T " h" H " NA", Vertical 1
   Gui, 99: Show, % "x" X + W " y" Y " w" T " h" H " NA", Vertical 2
}

Box_Hide() {
   Loop, 4
      Gui, % A_Index + 95 ":  Hide"
}

Uses my Box functions found here.

3nL8f.png


Beloved
  • Guests
  • Last active:
  • Joined: --
Hey, this look great and I've seen it in action. Works well.

However, I'm a bit new at AHS and you'll have to pardon my ignorance.

How exactly do you execute this command? As in, what are the hotkeys that need to be pressed (and in what succession)?

Just as well, I know there is one for item switching and one for attacking the TD itself. Are they both included in here? And just as well, I would imagine that command would have a different hotkey(s) so I'm curious to that as well.

Thanks for your time (and script). ^^

Gennoise
  • Members
  • 9 posts
  • Last active: Jan 24 2011 11:55 PM
  • Joined: 17 Jan 2011
Looks neat, but you might want to randomize the clicks a little bit, you know, just to be safe.
I'm also working on a couple of runescape macro's, and I'll share some of my tricks:

Use ControlGetPos to set the most accurate coordinates for runescape (because it detects the applet rather than the browser it's in):

SetTitleMatchMode 2 ;this allows you to use different browsers

IfWinExist, RuneScape
{
	WinActivate
	ControlGetPos, x, y, w, h, SunAwtCanvas2, RuneScape
	;x and y contain the coordinates of the top left corner of the applet (not the browser)
	;w and h contain the width and height of the applet
	WinGetActiveTitle, Title ;use Title for future references, if any
	;beware that this method may glitch if you have other windows open with RuneScape in their title
}

Randomize time between clicks by using a combination of Random and Sleep

RSleep(Min, Max) ;pass Min and Max values in miliseconds
{
	Random, r, Min, Max
	Sleep, r
}

Randomize the time that you hold the mouse button

RClick()
{
	Random, r, 10, 50
	Send {LButton down}
	sleep,r
	Send {LButton up}
}

Most importantly, don't make it click the exact same pixel over and over again.

Wicked - Guest
  • Guests
  • Last active:
  • Joined: --
Omg! I never thought of ControlGetPos!

And I've never heard of anyone getting banned for gear switching. I've used it for two years with no bans. :p.

I have written other scripts for it. To test how well Jagex's anti-bot actually worked, I made a new account with members. It got 7 99s, all botted. All took a mere two seconds to make undetectable.

The account was simply to test how much I could get away with. As soon as I removed the random click coordinates, it got a mere 2 week ban for macroing. Rofl.

Wicked
  • Members
  • 504 posts
  • Last active: Nov 02 2017 11:07 PM
  • Joined: 07 Jun 2008
After getting the coordinates for the window, any ideas why:

ControlClick, x55 y77, % "ahk_id " RuneScape_ID

Will only click where your mouse is and not at x55 y77?

3nL8f.png


Gennoise
  • Members
  • 9 posts
  • Last active: Jan 24 2011 11:55 PM
  • Joined: 17 Jan 2011
I think your syntax is incorrect
"ahk_id " RuneScape_ID

Shouldn't that be:
ahk_id %RuneScape_ID%
?

Also, x55,y77 is in the top left corner of the window, right? I can't think of a reason why you would want to click there in the first place.

Anyway this works perfectly fine for me
SetTitleMatchMode 2

WinGet, RuneScape_ID, ID, RuneScape
ifWinExist, ahk_id %RuneScape_ID%
	WinActivate
ControlClick, x500 y500, ahk_id %RuneScape_ID%

PS: judging by the amount of YEARS they have put into combatting macro's, let's just agree that it does take more than 2 seconds to write a decent anti-ban.

Thankyouxxxx
  • Guests
  • Last active:
  • Joined: --

Well, this script is for those that play RuneScape. It's a script that I've been using. You can see it in action here and here. It can also be used for PKing... A lot use it for that.

This script is one that I've always used for Tormented Demons... It's got me 56 Dragon Claws in under 3 months. =).

It will only work using Jagex's client... In re-sizable. Could change it, but it's what I use so I found no need.

To make it click the inventory slots you want, change Item_Numbers in the tilde hotkey.

#Persistent

CoordMode, Mouse, Screen
SetBatchLines, -1
SetMouseDelay, 0
SetTitleMatchMode, 3
SetWinDelay, -1
Box_Init("00FF00")
Inventory_Width := 200
Inventory_Height := 270
SysGet, Window_Border, 32, 33
WinGet, RuneScape_ID, ID, RuneScape
If (RuneScape_ID == "")
   ExitApp
WinGet, RuneScape_PID, PID, % "ahk_id " RuneScape_ID
Process, Exist, JagexLauncher.exe
If (ErrorLevel == 0 || (RuneScape_PID != ErrorLevel))
   ExitApp
SetTimer, Locate_Inventory, 0
Return

Locate_Inventory:
IfWinNotActive, % "ahk_id " RuneScape_ID
{
   Box_Hide()
   Return
}
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
If(RuneScape_Width < 775 || RuneScape_Height-Window_Border*2 < 566)
{
   Box_Hide()
   Return
}
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
Box_Draw(Inventory_X, Inventory_Y, 199, 270)
Return

`::
IfWinNotActive, % "ahk_id " RuneScape_ID
   Return
SetTimer, Locate_Inventory, Off
Item_Numbers = 1|5|9|13|17|21 ;CHANGE THIS TO DESIRED 
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
MouseGetPos, Mouse_X, Mouse_Y
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
;~ Inventory_X2 := Inventory_X+199
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
;~ Inventory_Y2 := Inventory_Y+270
First_Item_X := Inventory_X+38.5
First_Item_Y := Inventory_Y+28.5
StringSplit, Item_Numbers, Item_Numbers, |
Loop, % Item_Numbers0
{
	Item_X := First_Item_X+Mod(Item_Numbers%A_Index%-1, 4)*42
	Item_Y := First_Item_Y+Div(Item_Numbers%A_Index%-1, 4)*36
	MouseMove, % Item_X, % Item_Y
	Click
}
MouseMove, % Mouse_X, % Mouse_Y
SetTimer, Locate_Inventory, 0
Return

Div(X, Y) {
	Return Floor(X/Y)	
}

Box_Init(C="FF0000") {
   Gui, 96: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 96: Color, % C
   Gui, 97: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 97: Color, % C
   Gui, 98: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 98: Color, % C
   Gui, 99: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 99: Color, % C
}

Box_Draw(X, Y, W, H, T="1", O="I") {
   If(W < 0)
      X += W, W *= -1
   If(H < 0)
      Y += H, H *= -1
   If(T >= 2)
   {
      If(O == "O")
         X -= T, Y -= T, W += T, H += T
      If(O == "C")
         X -= T / 2, Y -= T / 2
      If(O == "I")
         W -= T, H -= T
   }
   Gui, 96: Show, % "x" X " y" Y " w" W " h" T " NA", Horizontal 1
   Gui, 98: Show, % "x" X " y" Y + H " w" W " h" T " NA", Horizontal 2
   Gui, 97: Show, % "x" X " y" Y " w" T " h" H " NA", Vertical 1
   Gui, 99: Show, % "x" X + W " y" Y " w" T " h" H " NA", Vertical 2
}

Box_Hide() {
   Loop, 4
      Gui, % A_Index + 95 ":  Hide"
}

Uses my Box functions found here.


Cant you make one for low detail, fixed screen. Im tryin but im failing :roll:

Thankyouxxxx
  • Guests
  • Last active:
  • Joined: --

Well, this script is for those that play RuneScape. It's a script that I've been using. You can see it in action here and here. It can also be used for PKing... A lot use it for that.

This script is one that I've always used for Tormented Demons... It's got me 56 Dragon Claws in under 3 months. =).

It will only work using Jagex's client... In re-sizable. Could change it, but it's what I use so I found no need.

To make it click the inventory slots you want, change Item_Numbers in the tilde hotkey.

#Persistent

CoordMode, Mouse, Screen
SetBatchLines, -1
SetMouseDelay, 0
SetTitleMatchMode, 3
SetWinDelay, -1
Box_Init("00FF00")
Inventory_Width := 200
Inventory_Height := 270
SysGet, Window_Border, 32, 33
WinGet, RuneScape_ID, ID, RuneScape
If (RuneScape_ID == "")
   ExitApp
WinGet, RuneScape_PID, PID, % "ahk_id " RuneScape_ID
Process, Exist, JagexLauncher.exe
If (ErrorLevel == 0 || (RuneScape_PID != ErrorLevel))
   ExitApp
SetTimer, Locate_Inventory, 0
Return

Locate_Inventory:
IfWinNotActive, % "ahk_id " RuneScape_ID
{
   Box_Hide()
   Return
}
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
If(RuneScape_Width < 775 || RuneScape_Height-Window_Border*2 < 566)
{
   Box_Hide()
   Return
}
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
Box_Draw(Inventory_X, Inventory_Y, 199, 270)
Return

`::
IfWinNotActive, % "ahk_id " RuneScape_ID
   Return
SetTimer, Locate_Inventory, Off
Item_Numbers = 1|5|9|13|17|21 ;CHANGE THIS TO DESIRED 
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
MouseGetPos, Mouse_X, Mouse_Y
Inventory_X := RuneScape_X+RuneScape_Width-200-Window_Border
;~ Inventory_X2 := Inventory_X+199
If(RuneScape_Width-Window_Border*2 > 995)
	Inventory_Y := RuneScape_Y+RuneScape_Height-308-Window_Border
Else
	Inventory_Y := RuneScape_Y+RuneScape_Height-345-Window_Border
;~ Inventory_Y2 := Inventory_Y+270
First_Item_X := Inventory_X+38.5
First_Item_Y := Inventory_Y+28.5
StringSplit, Item_Numbers, Item_Numbers, |
Loop, % Item_Numbers0
{
	Item_X := First_Item_X+Mod(Item_Numbers%A_Index%-1, 4)*42
	Item_Y := First_Item_Y+Div(Item_Numbers%A_Index%-1, 4)*36
	MouseMove, % Item_X, % Item_Y
	Click
}
MouseMove, % Mouse_X, % Mouse_Y
SetTimer, Locate_Inventory, 0
Return

Div(X, Y) {
	Return Floor(X/Y)	
}

Box_Init(C="FF0000") {
   Gui, 96: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 96: Color, % C
   Gui, 97: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 97: Color, % C
   Gui, 98: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 98: Color, % C
   Gui, 99: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 99: Color, % C
}

Box_Draw(X, Y, W, H, T="1", O="I") {
   If(W < 0)
      X += W, W *= -1
   If(H < 0)
      Y += H, H *= -1
   If(T >= 2)
   {
      If(O == "O")
         X -= T, Y -= T, W += T, H += T
      If(O == "C")
         X -= T / 2, Y -= T / 2
      If(O == "I")
         W -= T, H -= T
   }
   Gui, 96: Show, % "x" X " y" Y " w" W " h" T " NA", Horizontal 1
   Gui, 98: Show, % "x" X " y" Y + H " w" W " h" T " NA", Horizontal 2
   Gui, 97: Show, % "x" X " y" Y " w" T " h" H " NA", Vertical 1
   Gui, 99: Show, % "x" X + W " y" Y " w" T " h" H " NA", Vertical 2
}

Box_Hide() {
   Loop, 4
      Gui, % A_Index + 95 ":  Hide"
}

Uses my Box functions found here.


Cant you make one for low detail, fixed screen. Im tryin but im failing :roll:

jaxsect
  • Members
  • 1 posts
  • Last active: Nov 16 2015 04:24 AM
  • Joined: 13 Nov 2015

I've been using AHK for a while but nothing really serious. Just now learning some programming languages and taking a couple courses online. I've used this code before a long time ago and recently decided to take another look at it. After some new rs updates it no longer works. So I edited it so that it will! The part of the code that divides the box into equal parts and clicks the numbers that are indicated is some advanced math/coding that I still don't understand fully. Thanks alot to the original poster for this code and I hope this works for everyone. By the way if the box doesnt show up exactly on your inventory just move your inventory to fit the box ;).

 

#Persistent

CoordMode, Mouse, Screen
SetBatchLines, -1
SetMouseDelay, 0
SetTitleMatchMode, 3
SetWinDelay, -1
Box_Init("00FF00")
Inventory_Width := 200
Inventory_Height := 270
SysGet, Window_Border, 32, 33
WinGet, RuneScape_ID, ID, RuneScape
If (RuneScape_ID == "")
   ExitApp
WinGet, RuneScape_PID, PID, % "ahk_id " RuneScape_ID
Process, Exist, JagexLauncher.exe
If (ErrorLevel == 0 || (RuneScape_PID != ErrorLevel))
   ExitApp
SetTimer, Locate_Inventory, 0
Return

Locate_Inventory:
IfWinNotActive, % "ahk_id " RuneScape_ID
{
   Box_Hide()
   Return
}
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
If(RuneScape_Width < 775 || RuneScape_Height-Window_Border*2 < 566)
{
   Box_Hide()
   Return
}
Inventory_X := RuneScape_X+RuneScape_Width-180-Window_Border
Inventory_Y := RuneScape_Y+RuneScape_Height-405-Window_Border
Box_Draw(Inventory_X, Inventory_Y, 164, 257)
Return

`::
IfWinNotActive, % "ahk_id " RuneScape_ID
   Return
SetTimer, Locate_Inventory, Off
Item_Numbers = 2|6|10|11|18|20 ;CHANGE THIS TO DESIRED
WingetPos, RuneScape_X, RuneScape_Y, RuneScape_Width, RuneScape_Height, % "ahk_id " RuneScape_ID
MouseGetPos, Mouse_X, Mouse_Y
Inventory_X := RuneScape_X+RuneScape_Width-180-Window_Border
Inventory_Y := RuneScape_Y+RuneScape_Height-405-Window_Border
First_Item_X := Inventory_X+38.5
First_Item_Y := Inventory_Y+28.5
StringSplit, Item_Numbers, Item_Numbers, |
Loop, % Item_Numbers0
{
    Item_X := First_Item_X+Mod(Item_Numbers%A_Index%-1, 4)*42
    Item_Y := First_Item_Y+Div(Item_Numbers%A_Index%-1, 4)*36
    MouseMove, % Item_X, % Item_Y
    Click
}
MouseMove, % Mouse_X, % Mouse_Y
SetTimer, Locate_Inventory, 0
Return

Div(X, Y) {
    Return Floor(X/Y)    
}

Box_Init(C="FF0000") {
   Gui, 96: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 96: Color, % C
   Gui, 97: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 97: Color, % C
   Gui, 98: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 98: Color, % C
   Gui, 99: +ToolWindow -Caption +AlwaysOnTop +LastFound
   Gui, 99: Color, % C
}

Box_Draw(X, Y, W, H, T="1", O="I") {
   If(W < 0)
      X += W, W *= -1
   If(H < 0)
      Y += H, H *= -1
   If(T >= 2)
   {
      If(O == "O")
         X -= T, Y -= T, W += T, H += T
      If(O == "C")
         X -= T / 2, Y -= T / 2
      If(O == "I")
         W -= T, H -= T
   }
   Gui, 96: Show, % "x" X " y" Y " w" W " h" T " NA", Horizontal 1
   Gui, 98: Show, % "x" X " y" Y + H " w" W " h" T " NA", Horizontal 2
   Gui, 97: Show, % "x" X " y" Y " w" T " h" H " NA", Vertical 1
   Gui, 99: Show, % "x" X + W " y" Y " w" T " h" H " NA", Vertical 2
}

Box_Hide() {
   Loop, 4
      Gui, % A_Index + 95 ":  Hide"
}