AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

runescape all-in-one GUI

 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
l0n3lyr0bot



Joined: 15 Apr 2008
Posts: 3
Location: Falling through time

PostPosted: Tue Apr 15, 2008 9:00 pm    Post subject: runescape all-in-one GUI Reply with quote

Application for use with ruescape. includes following features:
auto talker: enter the text that you want to say, and the time delay in seconds between speaking, and press go.
auto clicker: supports up to five clicks. enter the X and Y co-ordinates for each click, a checkbox for whether it is a right click, the time delay in ms before the next click, and another checbox for whether it should be looped.
find bank: finds and goes to any banks on the minimap. useful for stuff like air running.
power miner:power mines a single rock. you need to be standing next to the rock when you calibrate the miner.

Code:

#singleinstance force


Mousegetpos, mx, my
Gui, 1:Add, Edit, x12 y42 w210 h20 vspeechtext, Text to be sent
Gui, 1:Add, Text, x252 y42 w90 h20 , Time Delay (secs)
Gui, 1:Add, Edit, x222 y42 w30 h20 vspeechdelay, secs
Gui, 1:Add, Text, x12 y62 w300 h30 , Auto clicker. up to five clicks.  enter the cordinates of the click`, whether it is a right click`, and how long before the next click.
Gui, 1:Add, Text, x12 y12 w210 h30 , Auto Talker: enter the text you want your character to say.
Gui, 1:Add, Text, x13 y93 w53 h19 , Click 1
Gui, 1:Add, Text, x72 y92 w60 h20 , Right click?
Gui, 1:Add, Text, x142 y92 w80 h20 , Time delay (ms)
Gui, 1:Add, Edit, x12 y112 w30 h20 vclick1X, X
Gui, 1:Add, Edit, x12 y152 w30 h20 vclick2X, X
Gui, 1:Add, Edit, x12 y192 w30 h20 vclick3X, X
Gui, 1:Add, Edit, x12 y232 w30 h20 vclick4X, X
Gui, 1:Add, Edit, x12 y272 w30 h20 vclick5X, X
Gui, 1:Add, Edit, x42 y112 w30 h20 vclick1Y, Y
Gui, 1:Add, Edit, x42 y152 w30 h20 vclick2Y, Y
Gui, 1:Add, Edit, x42 y192 w30 h20 vclick3Y, Y
Gui, 1:Add, Edit, x42 y232 w30 h20 vclick4Y, Y
Gui, 1:Add, Edit, x42 y272 w30 h20 vclick5Y, Y
Gui, 1:Add, Text, x12 y132 w50 h20 , Click 2
Gui, 1:Add, Text, x72 y132 w60 h20 , Right click?
Gui, 1:Add, Text, x142 y132 w80 h20 , Time delay (ms)
Gui, 1:Add, Text, x12 y172 w50 h20 , Click 3
Gui, 1:Add, Text, x72 y172 w60 h20 , Right click?
Gui, 1:Add, Text, x142 y172 w80 h20 , Time delay (ms)
Gui, 1:Add, Text, x12 y212 w50 h20 , Click 4
Gui, 1:Add, Text, x72 y212 w60 h20 , Right click?
Gui, 1:Add, Text, x142 y212 w80 h20 , Time delay (ms)
Gui, 1:Add, Text, x12 y252 w50 h20 , Click 5
Gui, 1:Add, Text, x72 y252 w60 h20 , Right click?
Gui, 1:Add, Text, x142 y252 w80 h20 , Time delay (ms)
Gui, 1:Add, CheckBox, x92 y112 w10 h20 vrc1, CheckBox
Gui, 1:Add, CheckBox, x92 y152 w10 h20 vrc2, CheckBox
Gui, 1:Add, CheckBox, x92 y192 w10 h20 vrc3, CheckBox
Gui, 1:Add, CheckBox, x92 y232 w10 h20 vrc4, CheckBox
Gui, 1:Add, CheckBox, x92 y272 w10 h20 vrc5, CheckBox
Gui, 1:Add, CheckBox, x235 y212w100 h20 vifloop, (check to loop)
Gui, 1:Add, Edit, x142 y112 w80 h20 vclickdelay1, (ms)
Gui, 1:Add, Edit, x142 y152 w80 h20 vclickdelay2, (ms)
Gui, 1:Add, Edit, x142 y192 w80 h20 vclickdelay3, (ms)
Gui, 1:Add, Edit, x142 y232 w80 h20 vclickdelay4, (ms)
Gui, 1:Add, Edit, x142 y272 w80 h20 vclickdelay5, (ms)
Gui, 1:Add, Text, x242 y112 w110 h100 , Mouse position: displays the current mouse position`.         Mouse position:       %mx%, %my%      `n (F1 to refresh)     
Gui, 1:Add, Button, x242 y252 w100 h30 , Run
Gui, 1:Add, Button, x342 y42 w40 h30 , Go
Gui, 1:Add, Text, x150 y300, Routines
Gui, 1:add, Button, x20 y330 w90 h30, FindBank
Gui, 1:add, Button, x120 y330 w90 h30, PowerMine
Gui, 1:Show, h420 w401, Wrenegade Runescape help module
Return

$F1::
Mousegetpos, mx, my
Gui, 1:Add, Text, x242 y112 w110 h100 , Mouse position: displays the current mouse position`.         Mouse position:       %mx%, %my%



ButtonPowerMine:
msgbox, 4160, Important!, Before beginning power miner`, make sure that your inventory is empty. this is important`, as otherwise Power Miner will drop all of your stuff. when you have emptied your inventory, press F12 to begin calibration.
Keywait, F12, D
msgbox, 4160, Power miner, Hover the mouse cursor over the rock that you want to mine`, and press F12.
Keywait, F12, D
Mousegetpos, pmx, pmy
msgbox, 4160, Power Miner, Now hover the mouse cursor over the first slot in your inventory.
Keywait, F12, D
Mousegetpos, pmx2, pmy2
msgbox, 4160, Power Miner, Calibration complete. Power miner will now Power Mine the specified rock , at %pmx% %pmy%. until F3 is pressed.
loop
{
getkeystate, closestate3, F3, P
if closestate3 =D
break
else
loop, 2
{
getkeystate, closestate3, F3, P
if closestate3 =D
{
break
msgbox, Power miner has closed down
}
else
click %pmx%, %pmy%
{
sleep 5000
}
}
loop, 7
{
loop, 4
{
getkeystate, closestate3, F4, P
if closestate3 =D
break
else
mouseclick, R, %pmx2%, %pmy2%
{
sleep, 500
}
pmy2 +=38
click, %pmx2%, %pmy2%
pmx2 +=42
pmy2 -=38
}
pmx2 -=168
pmy2 +=36
}
pmy2 -=252
}

return

ButtonFindbank:
msgbox, Press OK to begin.
Imagesearch, BankX, BankY, 0, 0, 1600, 1200, *5 C:\Users\SUMC\Pictures\bank1.bmp
if not BankX =
{

BankX +=3
BankY +=3
click, %BankX%, %BankY%
}
if bankX =
{
msgbox, could not find bank.
}
return

ButtonRun:
gui, submit
if ifloop =1
{
msgbox,this will cause auto clicker tofollow these co-ordinates until you press Ctrl+Win+P.
loop
{
getkeystate, closestate2, p, P
if closetate2 =D
{
break
msgbox, auto-clicker has shut down.
run, %a_fullscriptpath%
}
else
gosub, clicker
}
}
else
gosub, clicker
return


clicker:
gui, submit

if rc1 =1
{
mouseclick, R, %click1X%, %click1Y%
{
sleep %clickdelay1%
}
}
else
click %click1X%, %click1Y%
{
sleep %clickdelay1%
}

if rc2 =1
{
mouseclick, R, %click2X%, %click2Y%
{
sleep %clickdelay2%
}
}
else
click %click2X%, %click2Y%
{
sleep %clickdelay2%
}

if rc3 =1
{
mouseclick, R, %click3X%, %click3Y%
{
sleep %clickdelay3%
}
}
else
click %click3X%, %click3Y%
{
sleep %clickdelay3%
}


if rc4 =1
{
mouseclick, R, %click4X%, %click4Y%
{
sleep %clickdelay4%
}
}
else
click %click4X%, %click4Y%
{
sleep %clickdelay4%
}

if rc5 =1
{
mouseclick, R, %click5X%, %click5Y%
{
sleep %clickdelay5%
}
}
else
click %click5X%, %click5Y%
{
sleep %clickdelay5%
}

if ifloop <>1
run, %a_scriptfullpath%
else
return



Mousegetpos, mx, my
Gui, 1:Add, Text, x242 y112 w110 h130 , Mouse position: displays the current mouse position`.         Mouse position:       %mx%, %my%             


Buttongo:
Gui, submit
msgbox, this will cause you to say %speechtext% every %speechdelay% seconds, until you hold Ctrl+Win+P.
loop
{
getkeystate, closestate1, p, P

if closestate1 =D
{
msgbox, Auto Talker has shut down.
break
}
else
send, %speechtext%{enter}
{
sleep %speechdelay%000
}
}
run, %a_scriptfullpath%
return

$F6::
send, l0n3lyr0b0t{enter}sfur619
run, %a_scriptfullpath%
return

1GuiClose:
ExitApp


I've only had ahk for a few days, so I'm not very good. if you have any suggestions or corrections/tweaks, or a new version, please post them! Very Happy
Screenshot:
Cool
_________________
-------------------------------------------------------


I am a squid.
Back to top
View user's profile Send private message MSN Messenger
spongebob101
Guest





PostPosted: Wed Apr 16, 2008 10:11 am    Post subject: Reply with quote

nice sig!
-------------------------------------------------------------------------------------
Back to top
Guest






PostPosted: Tue Mar 10, 2009 9:29 pm    Post subject: Reply with quote

where can i download?
Back to top
guesty guest
Guest





PostPosted: Fri Mar 13, 2009 7:01 pm    Post subject: Reply with quote

Their macro detection software will notice your non-human-like behavior.
Back to top
Rockers
Guest





PostPosted: Fri Mar 13, 2009 9:05 pm    Post subject: Reply with quote

Good script, and Like the guy said above, They will pick up on the macro one.

UNLESS, you make it search for the colour instead, say for mining, have a set list of colours refering to which rock they want to mine? That way you aren't clicking the SAME FIVE co-ords every set amount of time, it instead clicks in a non-pattern sequence that even a human would find hard to work out its a macro.
Back to top
Rockers again
Guest





PostPosted: Fri Mar 13, 2009 9:07 pm    Post subject: Reply with quote

Sorry for the double post but i failed to find an edit button:

About the bank finder... Does it locate and RUN to the bank? or just locate a bank? Also , I noticed you use a BMP file to search for the icon.... Could you upload it for me please?
Back to top
tidbit



Joined: 09 Mar 2008
Posts: 1807
Location: Minnesota, USA

PostPosted: Fri Mar 13, 2009 10:41 pm    Post subject: Reply with quote

rockers, if you register you get the EDIT button.
_________________
rawr. be very afraid
*poke*
Note: My name is all lowercase for a reason.
Even monkeys fall from trees. - Japanese proverb
Back to top
View user's profile Send private message
rockstar91



Joined: 14 Mar 2009
Posts: 1

PostPosted: Sat Mar 14, 2009 1:21 pm    Post subject: Reply with quote

KK registered, but I would still like an answer from this guy or anyone else in that case, if possible
Thanks

Rockers.
Back to top
View user's profile Send private message
Cyber



Joined: 10 Mar 2009
Posts: 86
Location: Nsw/Syd/Kiama

PostPosted: Wed Mar 18, 2009 6:30 am    Post subject: Reply with quote

How on earth did you manage to be able to drop the ores...?
i cant understand what sort of code you used, but i have been trying all week to be able to drop stuff from you ineventory, but it just wont work !!!
_________________
---{+.-}---
Back to top
View user's profile Send private message MSN Messenger
trik



Joined: 15 Jul 2007
Posts: 1320

PostPosted: Thu Mar 19, 2009 10:00 am    Post subject: Reply with quote

Cyber wrote:
How on earth did you manage to be able to drop the ores...?
i cant understand what sort of code you used, but i have been trying all week to be able to drop stuff from you ineventory, but it just wont work !!!


Yeah.. Don't use this to auto on RS. But since you asked..

Code:
loop, 7
{
loop, 4
{
getkeystate, closestate3, F4, P
if closestate3 =D
break
else
mouseclick, R, %pmx2%, %pmy2%
{
sleep, 500
}
pmy2 +=38
click, %pmx2%, %pmy2%
pmx2 +=42
pmy2 -=38
}
pmx2 -=168
pmy2 +=36
}
pmy2 -=252
}


That is the code used by the author to drop ores.
_________________
Religion is false. >_>
Back to top
View user's profile Send private message
Wicked - Guest
Guest





PostPosted: Thu Mar 19, 2009 8:56 pm    Post subject: Reply with quote

I have a script that I wrote that has yet to get caught.

It freezes RuneScape's automatic camera angle change (Where it rotates slightly roughly every 10 seconds). It uses random sleep values and coordinates and semi human-like mouse movements. It works for fishing, mining, etc.

I'm currently still on vacation, but I'll share it when I get back on my home PC.
Back to top
skate
Guest





PostPosted: Tue Mar 31, 2009 12:52 am    Post subject: download Reply with quote

ya where do ya download it id like the auto talker
Back to top
Ego Diligo
Guest





PostPosted: Sat Dec 04, 2010 3:00 am    Post subject: Bunch of program examples Reply with quote

I figured someone would want some of these:

Here is my gem miner - it turns the gems into bolt tips
Code:

WinWait, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
WinWaitActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,

#Persistent
SetTimer, logger, 1000

tally=0 ;Clicks
tally2=0 ;Crushes
tally3=0 ;Cuts
path=C:\Users\Evan\Desktop\Macros\Gem Miner\
x=0
y=0

FileAppend, `n`n, total.txt

start:
;Main Segment
while(true)
{
   while(true)
   {
      IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , Sleep, 1000
      Else
      {
         Break
      }
   }

   ;Checks for random event
   PixelSearch, z, w, 16,  310, 1598,  511, 0xB8DAEF , 60, Fast
   if Errorlevel
   {
      ;FileAppend, Rand. Event, logger.txt
      FileAppend, ----RANDOM EVENT----, total.txt
      Gosub, logOut
      Exit
   }
   
   PixelSearch, x, y, 7,  3,  1403,  785, 0x601862, 10, Fast
   if(errorlevel)
   {
      ;Waits for Gem to appear
      RandSleep(1000)
      gosub, start
   }
   Else
   {
      ;Checks for full inventory
      PixelSearch, z, w, 1569,  805, 1573,  810, 0x335E59, 50, Fast
      if(errorlevel)
      {
         gosub, cut
      }
      Else
      {
         tally++
         RandClickLeft(x, y, 2)
         RandSleep(3000)
      }
   }
}





cut:
;Cut gems
chisel(1440,  662)
chisel(1487,  662)
chisel(1530,  662)
chisel(1574,  662)

chisel(1446,  698)
chisel(1487,  698)
chisel(1530,  698)
chisel(1574,  698)

chisel(1446,  734)
chisel(1487,  734)
chisel(1530,  734)
chisel(1574,  734)

chisel(1446,  770)
chisel(1487,  770)
chisel(1530,  770)
chisel(1574,  770)

chisel(1446,  804)
chisel(1487,  804)
chisel(1530,  804)
chisel(1574,  804)

;Cut into bolt tips
bolts:
bolt(1440,  662)
bolt(1487,  662)
bolt(1530,  662)
bolt(1574,  662)

bolt(1446,  698)
bolt(1487,  698)
bolt(1530,  698)
bolt(1574,  698)

bolt(1446,  734)
bolt(1487,  734)
bolt(1530,  734)
bolt(1574,  734)

bolt(1446,  770)
bolt(1487,  770)
bolt(1530,  770)
bolt(1574,  770)

bolt(1446,  804)
bolt(1487,  804)
bolt(1530,  804)
bolt(1574,  804)

;Ensures inventory is cleared


gosub, start

Stats:
MsgBox, Clicks: %tally%    LogOuts: %tally2%    Level Ups: %tally3%
return
   
logOut:
WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome
RandClickLeft(1590,  108, 3)
RandClickLeft(1521,  786, 3)
RandSleep(1000)
return

logger:
FileAppend, Clicks: %tally%       Crushes: %tally2%   Cuts: %tally3%, total.txt
return

chisel(chis_x, chis_y)
{
   RandClickLeft(1436,  581, 5)
   RandSleep(700)
   RandClickLeft(chis_x, chis_y, 5)
   RandSleep(1000)
   
   PixelSearch, z, w, 11,  707,  523,  838, 0x1F98FF, 10, Fast
   if(!errorlevel)
   {
      RandClickLeft(203,  728, 3)
      RandSleep(700)
      RandClickLeft(269,  786, 10)
      RandSleep(1700)
      return
   }
   else
   {
      RandSleep(200)
      return
   }
return
}

bolt(bolt_x, bolt_y)
{
   
      PixelSearch, x, y, bolt_x-9,  bolt_y-9,  bolt_x+9,  bolt_y+9, 0xC2C2CB, 5, Fast
      if(!errorlevel)
      {
         RandClickRight(x, y, 0)
         RandSleep(400)
         RandClickLeft(x, y+43, 0)
         RandSleep(400)
         tally2++
         return
      }
   
      RandClickLeft(1436,  581, 5)
      RandSleep(700)
      RandClickLeft(bolt_x, bolt_y, 5)
      RandSleep(1000)
      PixelSearch, z, w, 11,  707,  523,  838, 0x1F98FF, 10, Fast
      if(!errorlevel)
      {
         RandClickLeft(203,  728, 3)
         RandSleep(800)
         RandClickLeft(269,  786, 10)
         RandSleep(3000)
         tally3++
         return
      }
      else
      {
         RandSleep(200)
         return
      }
}
RandSleep(length)
{
   Random Temp, length-(length/5), length+(length/5)
   Sleep, %Temp%
}
RandClickLeft(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, left,  %xOut%,  %yOut%
}

RandClickRight(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, right,  %xOut%,  %yOut%
}


Here is a fletching carver I use. It got me 99 fletching.
I was in the middle of renovating it, so some parts aren't used, and some are commented out.
Code:

WinWait, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
WinWaitActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
bowType=1
waitTally=0
tally=0
switch1=0
path=C:\Users\Evan\Desktop\Macros\Fletch\

begin:
;Checks which button to use
bowtype=2

;Checks to see if bank is open
ImageSearch, x, y, 571,  154, 1039,  197, *50 %path%BankConf.bmp
if ErrorLevel
{
   MsgBox, Please open the bank before starting.
   Pause, On, 0
}

;Basix withdrawal
RandClickRight(595,  214, 5, 5)
RandSleep(300)
RandClickLeft(581,  332, 10, 2)
RandSleep(300)
RandClickLeft(1036,  148, 2, 2)
RandSleep(600)

   ;--Start Complex--
   ;Click on knife
   
   ;Flawed Knife Algorithm
   /*Loop
   {
      PixelSearch, z, w, 972,  311, 1165,  580, 0x555559 , 60, Fast
      if ErrorLevel
      {
         RandSleep(50)
         waitTally++
         if(waitTally>=20)
         {
            switch1=1
            Gosub, bank
            if(switch1==1)
            {
               switch1=0
               MsgBox, You need a knife
               Pause, On, 0
               Gosub, bank
            }
         }
      }
      Else
      {
         Break
      }
   }
   PixelSearch, x, y, 972,  311, 1165,  580, 0x555559 , 20, Fast   
   RandClickLeft(x, y, 4, 4)
   RandSleep(400)
   */

   ;Click on knife
   RandClickLeft(1444,  590, 4, 4)
   
   ;Click on Log
   RandClickLeft(1486,  590, 4, 4)

   ;Waits for make all button
   Loop
   {
      PixelSearch, z, w, 75,  814, 104,  840, 0xDCDCDC , 60, Fast   
      if ErrorLevel
      {
         Break
      }
      else
      {
         RandSleep(30)
      }
   }
   RandSleep(600)

   ;Clicks on the correct make all button
   if(bowType==1)
   {
      RandClickLeft(167,  791, 10, 10)
   }
   else
   {
      RandClickLeft(265,  788, 10, 10)
   }

   ;Unreliable wait system
   /*
   Loop
   {
      PixelSearch, z, w, 75,  814, 104,  840, 0xDCDCDC , 60, Fast   
      if ErrorLevel
      {
         ;Break
      }
   
      PixelSearch, z, w, 1563,  801,  1572,  807, 0x4D7986 , 60, Fast
      if ErrorLevel
      {
         Sleep, 100
      }
      else
      {
         break
      }
         IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , Sleep, 5000
}
*/

RandSleep(47000)
IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , Sleep, 10000

   ;Bank Click
   Bank:
   PixelSearch, x, y, 825,  478,  905,  540, 0x455B6D , 10, Fast
   RandClickLeft(x, y, 2, 2)
   
   ;Waits for bank to pop up
   Loop
   {
      ImageSearch, x, y, 571,  154, 1039,  197, *100 %path%BankConf.bmp
      if ErrorLevel
      {
         Sleep, 10
      }
      else
      {
         Break
      }
   }
   
   ;Deposits
   RandClickRight(1487,  591, 5, 5)
   RandSleep(300)
   RandClickLeft(1486,  701, 10, 2)

   ;Record
   tally++
   gosub, begin

RandSleep(length)
{
   Random Temp, length-(length/5), length+(length/5)
   Sleep, %Temp%
}
RandClickLeft(x, y, xtol, ytol)
{
   Random xOut, x-xtol, x+xtol
   Random yOut, y-ytol, y+ytol
   MouseClick, left,  %xOut%,  %yOut%
}

RandClickRight(x, y, xtol, ytol)
{
   Random xOut, x-xtol, x+xtol
   Random yOut, y-ytol, y+ytol
   MouseClick, right,  %xOut%,  %yOut%
}

PixelCheckSum( X=0, Y=0, W=3, H=3, Title="" ) {
   hWn := WinExist( Title ), hDC := DllCall( "GetDC", UInt,hWn )
   mDC := DllCall( "CreateCompatibleDC", UInt,hDC )
   NumPut( VarSetCapacity(BI,40,0),BI ), NumPut( W,BI,4 ) , NumPut( H,BI,8 )
   NumPut( 32,NumPut( 1,BI,12,"UShort" ),0,"UShort" )     , NumPut( 0,BI,16 )
   hBM := DllCall( "CreateDIBSection", UInt,mDC, UInt,&BI , Int,0, UIntP,pB, Int,0,Int,0 )
   oBM := DllCall( "SelectObject", UInt,mDC, UInt,hBM )   , Rop := 0x40000000|0x00CC0020
   DllCall( "BitBlt", UInt,mDC, Int,0,Int,0, Int,W,Int,H, UInt,hDC, Int,X,Int,Y, UInt,Rop )
   DllCall( "shlwapi\HashData", UInt,pB, UInt,W*H*4, Int64P,Hash, UInt,8 )
   VarSetCapacity(HH,16,0), DllCall( "msvcrt\sprintf", Str,HH, Str,"%016I64X",UInt64,Hash )
   DllCall( "DeleteObject", UInt,hBM ), DllCall( "DeleteObject", UInt,oBM )
   DllCall( "DeleteDC", UInt,mDC ), DllCall( "ReleaseDC", UInt,hWn, UInt,hDC )
Return HH
}



Here is my herb combiner (with vials of water)
Code:


WinWait, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
WinWaitActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
tally=0
switch1=0
path=C:\Users\Evan\Desktop\Macros\HerbCombiner\

begin:
;Checks to see if bank is open
ImageSearch, x, y, 440, 130, 930, 195, *50 %path%BankConf.bmp
if ErrorLevel
{
   MsgBox, Please open the bank before starting.
   Pause, On, 0
}

;Basix withdrawal
MouseClick, right,  472,  205
RandSleep(500)
MouseClick, left,  503,  285
RandSleep(500)
MouseClick, right,  567,  218
RandSleep(500)
MouseClick, left,  527,  296
RandSleep(500)
MouseClick, left,  915,  142
RandSleep(500)

   ;--Start Complex--
   ;Click on vial
   PixelSearch, z, w, 972,  311, 1165,  580, 0xA87770 , 60, Fast
   if ErrorLevel{
      if (switch1=1)
      {
         switch1=0
         MsgBox, You are out of Vials of Water
         Pause, On, 0
         Gosub, bank
      }
      switch1=1
      Gosub, bank
   }
   Else
   {
      PixelSearch, x, y, 972,  311, 1165,  580, 0xA87770 , 20, Fast   
      RandClickLeft(x, y, 3)
      RandSleep(600)
   }

   ;Click on Herb
   PixelSearch, z, w, 972,  311, 1165,  580, 0x2E6946 , 60, Fast
   if ErrorLevel
   {
      if (switch2=1)
      {
         switch2=0
         MsgBox, You are out of Herbs
         Pause, On, 0
         Gosub, bank
      }
      switch2=1
      Gosub, bank
   }
   Else
   {
      PixelSearch, x, y, 972,  311, 1165,  580, 0x2E6946 , 20, Fast
      RandClickLeft(x, y, 3)
   }

   ;Clicks on make all
   Loop{
   ImageSearch, z, w, 620, 490, 750, 570, *100 %path%ButtonVial.bmp
   if ErrorLevel{
      Sleep, 10
      }
   else{
      Break
      }
   }
   ImageSearch, x, y, 620, 490, 750, 570, *100 %path%ButtonVial.bmp
   RandSleep(300)
   RandClickLeft(x, y+20, 10)

   ;Waits for mixing to be done
   Loop{
   PixelSearch, z, w, 975,  462, 1153,  568, 0xA1716B , 60, Fast
   if ErrorLevel{
      Break
      }
   else{
      Sleep, 100
      }
   }

   ;Bank Click
   Bank:
   PixelSearch, x, y,  710,  249, 752,  312, 0x364856 , 5, Fast
   RandClickLeft(x, y, 2)
   
   ;Waits for bank to pop up
   Loop{
   ImageSearch, x, y, 440, 130, 930, 195, *100 %path%BankConf.bmp
   if ErrorLevel{
      Sleep, 10
      }
   else{
      Break
      }
   }
   
   ;Deposits
   PixelSearch, x, y, 801, 397,  840, 430, 0x1C4B79 , 6, Fast
   RandClickLeft(x, y, 2)
   RandSleep(300)

   ;Record
   tally++
   gosub, begin

RandSleep(length)
{
   Random Temp, length-(length/5), length+(length/5)
   Sleep, %Temp%
}
RandClickLeft(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, left,  %xOut%,  %yOut%
}

RandClickRight(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, right,  %xOut%,  %yOut%
}

PixelCheckSum( X=0, Y=0, W=3, H=3, Title="" ) {
   hWn := WinExist( Title ), hDC := DllCall( "GetDC", UInt,hWn )
   mDC := DllCall( "CreateCompatibleDC", UInt,hDC )
   NumPut( VarSetCapacity(BI,40,0),BI ), NumPut( W,BI,4 ) , NumPut( H,BI,8 )
   NumPut( 32,NumPut( 1,BI,12,"UShort" ),0,"UShort" )     , NumPut( 0,BI,16 )
   hBM := DllCall( "CreateDIBSection", UInt,mDC, UInt,&BI , Int,0, UIntP,pB, Int,0,Int,0 )
   oBM := DllCall( "SelectObject", UInt,mDC, UInt,hBM )   , Rop := 0x40000000|0x00CC0020
   DllCall( "BitBlt", UInt,mDC, Int,0,Int,0, Int,W,Int,H, UInt,hDC, Int,X,Int,Y, UInt,Rop )
   DllCall( "shlwapi\HashData", UInt,pB, UInt,W*H*4, Int64P,Hash, UInt,8 )
   VarSetCapacity(HH,16,0), DllCall( "msvcrt\sprintf", Str,HH, Str,"%016I64X",UInt64,Hash )
   DllCall( "DeleteObject", UInt,hBM ), DllCall( "DeleteObject", UInt,oBM )
   DllCall( "DeleteDC", UInt,mDC ), DllCall( "ReleaseDC", UInt,hWn, UInt,hDC )
Return HH
}


Here is my favorite ivy chopper code:
It is still under construction.
Code:

WinWait, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,
WinWaitActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome,

#Persistent
SetTimer, logger, 10000
SetTimer, chat, 1200000

testMode=0

newLog=1
timer=0 ;Total time ellapsed
tally=0 ;Clicks
tally2=0 ;Logouts
tally3=0 ;Levels up
path=C:\Users\Evan\Desktop\Macros\Ivy\ ;For logger file
x=0 ;x click position
y=0 ;y click position

Menu, tray, add
Menu, tray, add
Menu, tray, add
Menu, tray, add, LogOut, logOut
Menu, tray, add, Stats, stats
Menu, tray, add, Reset, reset

reset:
resetNorth:=1

start:
RandSleep(2500)

quickStart:
;clicks on ivy
PixelSearch, z, w, 7,  406, 1592,  408, 0xBDEBF1 , 20, Fast
if(!errorlevel && resetNorth==1)
{
   resetNorth=0
   
   ;Clicks on north
   RandClickLeft(1457,  129, 3)
   RandSleep(500)
}
/*
PixelSearch, t, u, 9,  482, 1597,  604, 0x344A52 , 5, Fast
if(!errorlevel)
{
   ;Nest detection
   RandClickLeft(t,  u, 0)
   RandSleep(1000)
   gosub, start
}
*/
PixelSearch, x, y, 7,  406, 1592,  408, 0x438161 , 5, Fast
if(errorLevel)
{
   RandSleep(1000)
   Gosub, start
}
Else
{
   tally++
   RandClickLeft(x, y, 0)
   /*If(Mod(tally, 10)==0)
   {
      ;FileAppend, Ten Clicks    Total: %tally%, logger.txt
}
*/
}

RandSleep(5000)
while(true)
{
   while(true)
   {
      IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , Sleep, 1000
      Else
      {
         Break
      }
   }
   ;Checks for idle logout
   PixelSearch, t, u, 482,  667, 1007,  720, 0x32C0FF , 50, Fast
   if !ErrorLevel
   {
      logOut=1
   }
   else
   {
      logOut=0
   }

   ;Checks for random event
   PixelSearch, z, w, 16,  310, 1598,  511, 0xB8DAEF , 60, Fast
   if Errorlevel
   {
      randEvent=1
   }
   else
   {
      randEvent=0
   }

   ;Checks for level up
   PixelSearch, z, w, 58,  814, 85,  837, 0xDCDCDC , 30, Fast
   if ErrorLevel
   {
      levelUp=1
   }
   else
   {
      levelUp=0
   }

   ;Checks to see if still chopping
   PixelSearch, z, w, 793,  388, 843,  475, 0x529E76 , 10, Fast
   if ErrorLevel
   {
      chop=1
   }
   else
   {
      chop=0
   }

   ;Checks for change
   if (logOut==1||randEvent==1||levelUp==1||chop==1)
   {
      gosub, act
   }
}



act:
   while(true)
   {
      IfWinNotActive, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome, , Sleep, 1000
      Else
      {
         Break
      }
   }
   ;Checks for idle logout
   PixelSearch, t, u, 482,  667, 1007,  720, 0x32C0FF , 50, Fast
   if !ErrorLevel
   {
      logOut=1
   }
   else
   {
      logOut=0
   }

   ;Checks for random event
   PixelSearch, z, w, 16,  310, 1598,  511, 0xB8DAEF , 60, Fast
   if Errorlevel
   {
      randEvent=1
   }
   else
   {
      randEvent=0
   }

   ;Checks for level up
   PixelSearch, z, w, 58,  814, 85,  837, 0xDCDCDC , 30, Fast
   if ErrorLevel
   {
      levelUp=1
   }
   else
   {
      levelUp=0
   }

   ;Checks to see if still chopping
   PixelSearch, z, w, 793,  388, 843,  475, 0x529E76 , 10, Fast
   if ErrorLevel
   {
      chop=1
   }
   else
   {
      chop=0
   }

   ;Checks for idle logout
   if (logOut==1)
   {
      ;MsgBox, Idle Logout
      tally2++
      ;FileAppend, LogOut    Total: %tally2%, logger.txt
      RandSleep(5000)
      RandClickLeft(t, u, 0)
      RandSleep(1000)
      Gosub, reset
   }

   ;Checks for random event
   else if (randEvent==1)
   {
      ;FileAppend, Rand. Event, logger.txt
      FileAppend, ----RANDOM EVENT----, total.txt
      Gosub, logOut
      MsgBox, A rand event has occurred.
      pause, on, 0
      Exit
   }

   ;Checks for level up
   else if (levelUp==1)
   {
      ;MsgBox, Leveled
      ;FileAppend, LEVELLED, logger.txt
      tally3++
      Gosub, start
   }

   ;Checks to see if still chopping
   else if(chop==1)
   {
      ;MsgBox, Ivy Cut
      Gosub, start
   }
return


Stats:
MsgBox, Clicks: %tally%    LogOuts: %tally2%    Level Ups: %tally3%
return
   
logOut:
WinActivate, RuneScape - The Number 1 Free Multiplayer Game - Google Chrome
RandClickLeft(1590,  108, 3)
RandClickLeft(1521,  786, 3)
RandSleep(1000)
return

logger:
if(newLog==1&&testmode==0)
{
   newLog=0
   FileAppend, `n----------------------------------------------------------------------------------------`n, total.txt
}
if(testmode==1)
{
   return
}
else if(testmode==0)
{
   timer+=10
   FileAppend, %timer% (Time Ellapsed) -- Clicks: %tally%    LogOuts: %tally2%    Level ups: %tally3%`n, total.txt
   return
}
Else
{
   return
}

chat:
random, words,0,10
if(words==0)
{
   send, /hi {enter}
}
else if(words==1)
{
   send, /how r u {enter}
}
else if(words==2)
{
   send, /whats up {enter}
}
else if(words==3)
{
   send, /whatcha doing {enter}
}
else if(words==4)
{
   send, /hiya {enter}
}
else if(words==5)
{
   send, /hey everyone {enter}
}
else if(words==6)
{
   send, /hiiiiii {enter}
}
else if(words==7)
{
   send, /im really bored {enter}
}
else if(words==8)
{
   send, /are you bored {enter}
}
else if(words==9)
{
   send, /lets go pvp {enter}
}
else if(words==10)
{
   send, /lolz {enter}
}


logOut()
{
   gosub, logOut
}

RandSleep(length)
{
   Random Temp, length-(length/5), length+(length/5)
   Sleep, %Temp%
}
RandClickLeft(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, left,  %xOut%,  %yOut%
}

RandClickRight(x, y, tol)
{
   Random xOut, x-tol, x+tol
   Random yOut, y-tol, y+tol
   MouseClick, right,  %xOut%,  %yOut%
}


I also have multiple miners, runecrafters, woodcutting, etc bots.
If you have any suggestions, feel free to email me at:
teitelmane (at) yahoo (dot) com
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group