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 Macro

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



Joined: 02 Apr 2008
Posts: 13

PostPosted: Thu Apr 03, 2008 12:00 am    Post subject: RuneScape All-in-One Macro Reply with quote

I just found AHK about a week ago, and I decided to make an All-in-One RuneScape Macro. This is only version 0.5, so there are still (hopefully) many features to come.

Current Features

  • UseItems (Control+U) - Will automatically use/drop/examine/etc. all items in the specified rows. Useful for burying bones or dropping wood/ores when power mining/woodcutting.
  • AutoChat (Control+C) - Will automatically send a specified chat message every 30 seconds. (NOTE: You must enclose characters such as !, ^, &, etc. in curly braces)
  • Logout Prevention (Control+L) - Will automatically press the left arrow key every 10 seconds to prevent logging out.
  • Configurable Hotkeys


Usage
Use the hotkeys described above to start any of the functions, or right-click the tray icon. Press Control+Q to quit. Instructions are displayed when you use any of the functions, and most of it should be pretty self-explanatory. Double-click the tray icon to configure.

Code
main.ahk
Code:

;Directives
if (A_IsCompiled=1) {
   #SingleInstance ignore
} else {
   #SingleInstance force
}
#MaxThreadsPerHotkey 2
#Persistent

;Set Hotkey variables
HotkeysDisabled=0
UseItemsKey=^U
AutoChatKey=^C
LogoutPreventionKey=^L
QuitKey=^Q

;Set function variables
Chatting=0
ChatMsg=
PreventingLogout=0
bucklex=0
buckley=0

;Set mouse and key speed settings
SetDefaultMouseSpeed, 10
SetKeyDelay, 150

;Startup the macro
GoSub, CreateMenu
GoSub, CreateHotkeys
GoSub, CreateGui
return

;Include all the needed functions
#include menu.ahk
#include gui.ahk
#include functions.ahk


menu.ahk
Code:

CreateMenu:
   Menu, TRAY, Tip, RuneScape All-in-One Macro
   Menu, TRAY, NoStandard
   Menu, TRAY, Icon, *, , 1
   Menu, TRAY, Add, Use Items, UseItems
   Menu, TRAY, Add, Auto Chat, AutoChat
   Menu, TRAY, Add, Logout Prevention, LogoutPrevention
   Menu, TRAY, Add
   Menu, TRAY, Add, Configure, Configure
   Menu, TRAY, Default, Configure
   Menu, TRAY, Add, Disable Hotkeys, DisableHotkeys
   Menu, TRAY, Add, Quit, Quit
return


gui.ahk
Code:

CreateGui:
   Gui, Add, GroupBox, x15 y10 w240 h140 , Hotkeys
   Gui, Add, Text, x25 y30 w100 h20, Use Items
   Gui, Add, Hotkey, x125 y30 w100 h20 vUseItemsKey, %UseItemsKey%
   Gui, Add, Text, x25 y60 w100 h20, Auto Chat
   Gui, Add, Hotkey, x125 y60 w100 h20 vAutoChatKey, %AutoChatKey%
   Gui, Add, Text, x25 y90 w100 h20, Logout Prevention
   Gui, Add, Hotkey, x125 y90 w100 h20 vLogoutPreventionKey, %LogoutPreventionKey%
   Gui, Add, Text, x25 y120 w100 h20, Quit
   Gui, Add, Hotkey, x125 y120 w100 h20 vQuitKey, %QuitKey%
   Gui, Add, Button, x15 y160 w240 h30 gGuiGetBucklePos, Get Inventory Icon Position
   Gui, Add, Button, x15 y200 w115 h30 Default gGuiSubmit, Done
   Gui, Add, Button, x140 y200 w115 h30 gGuiClose, Cancel
return

GuiGetBucklePos:
   Gui, Show, Hide
   GoSub, GetBucklePos
   Gui, Show
return

GuiSubmit:
   Gui, Submit
   GoSub, DisableHotkeys
   GoSub, CreateHotkeys
return

GuiClose:
   GoSub, DisableHotkeys
   Gui, Cancel
return


functions.ahk
Code:


GetBucklePos: ;Gets the position of the inventory backpack icon
   SplashTextOn, 200, 50, Inventory Icon Position, Please click on the buckle of the inventory backpack icon.
   WinMove, Inventory Icon Position, , 0, 0
   KeyWait, LButton, D
   MouseGetPos, bucklex, buckley
   SplashTextOff
return

UseItems: ;Use rows of items
   if (bucklex=0 and buckley=0)
      GoSub, GetBucklePos
   InputBox, StartRow, Use Items, Enter the starting inventory row number., , , , , , , , 1
   if ErrorLevel
      return
   InputBox, EndRow, Use Items, Enter the ending inventory row number., , , , , , , , 7
   InputBox, OptionNum, Use Items, Enter the option number of the action to take on the items., , , , , , , , 1
   if ErrorLevel
      return
   ;Loop through the rows
   CurRow=%StartRow%
   SplashTextOn, 200, 50, Use Items, Using items in rows %StartRow% through %EndRow%.
   WinMove, Use Items, , 0, 0
   Send {Esc}
   Loop {
      Loop 4 {
         xpos=1020+(%A_Index%*4)
         if (OptionNum=1)
            MouseClick, left,  bucklex-75+((A_Index-1)*42),  buckley+48+((CurRow-1)*36)
         if (OptionNum>1) {
            row7adjust=0
            if (CurRow=7)
               row7adjust=-15
            MouseClick, right,  1020+((A_Index-1)*42),  492+((CurRow-1)*36)
            MouseClick, left,  1020+((A_Index-1)*42),  492+((CurRow-1)*36)+(OptionNum*15)+row7adjust+10
         }
         Sleep, 2500
      }
      EnvAdd, CurRow, 1
      if (CurRow>EndRow)
         break
   }
   SplashTextOff
return

AutoChat: ;Automatically sends a chat message every certain number of milliseconds until the user presses Control+C again
   if (Chatting=0) {
      InputBox, ChatMsg, Auto Chat, Enter the chat message you would like to automatically send., , , , , , , , %ChatMsg%
      if ErrorLevel
         return
      InputBox, ChatTime, Auto Chat, Enter how long you would like to wait between each sent message., , , , , , , , 30000
      SplashTextOn, 200, 100, AutoChat, AutoChat will start in 10 seconds. Please click anywhere inside of the RuneScape applet.
      WinMove, AutoChat, , 0, 0
      Sleep, 10000
      SplashTextOn, 175, 50, AutoChat, AutoChat on. Press Control+C again to stop.
      WinMove, AutoChat, , 0, 0
      Chatting=1
      Loop {
         if (Chatting=0) {
            SplashTextOff
            break
         }
         Send, %ChatMsg%{enter}
         Sleep, %ChatTime%
      }
   } else {
      SplashTextOn, 100, 50, AutoChat, Stopping AutoChat...
      WinMove, AutoChat, , 0, 0
      Chatting=0
   }
return

LogoutPrevention:
   if (PreventingLogout=0) {
      SplashTextOn, 200, 50, Logout Prevention, Logout Prevention will start in 10 seconds.
      WinMove, Logout Prevention, , 0, 0
      Sleep, 10000
      SplashTextOn, 200, 50, Logout Prevention, Logout Prevention on. Press Control+L again to stop.
      WinMove, Logout Prevention, , 0, 0
      PreventingLogout=1
      Loop {
         if (PreventingLogout=0) {
            SplashTextOff
            break
         }
         Send, {Left}
         Sleep, 10000
      }
   } else {
      SplashTextOn, 150, 50, Logout Prevention, Stopping Logout Prevention...
      WinMove, Logout Prevention, , 0, 0
      PreventingLogout=0
   }
return

CreateHotkeys:
   Hotkey, %UseItemsKey%, UseItems
   Hotkey, %AutoChatKey%, AutoChat
   Hotkey, %LogoutPreventionKey%, LogoutPrevention
   Hotkey, %QuitKey%, Quit
return

Configure:
   if (HotkeysDisabled=0)
      GoSub, DisableHotkeys
   Gui, Show, h240 w275, RS All-in-One Macro Config
return

DisableHotkeys:
   if (HotkeysDisabled=0) {
      Suspend, On
      Menu, TRAY, Check, Disable Hotkeys
      HotkeysDisabled=1
   } else {
      Suspend, Off
      Menu, TRAY, Uncheck, Disable Hotkeys
      HotkeysDisabled=0
   }
return

Quit:
   ExitApp
return

Future Features

  • Randomize clicks within a few pixels and key presses within a several milliseconds to avoid macro detection.
  • Power miner/woodcutter with random event detection
  • Automatic Login
  • Saving settings for hotkeys to a file loaded at startup
  • Highscore lookups (?)
  • Auto Air Runner (?) - Runs to the bank, stores noted essence, withdraws unnoted essence, and runs back
  • Disable hotkeys when the RuneScape window is not open


Feedback
If anyone has any feedback for new features, or things I could do to improve what I have already, it would be greatly appreciated. I am planning on making a small site for the macro once some more features have been added, which will contain a downloadable executable.

Disclaimer
You use this macro completely at your own risk. I have not extensively tested it for long periods of time, so there may be bugs, and you may be banned if Jagex finds out you are using it. I take no responsibility for any damage to your computer and/or your RuneScape account.

Thanks To
Chris Mallett - For making AutoHotKey, without which this wouldn't be possible.
Rajat - For making SmartGUI Creator, which probably saved me a lot of time making the Configure GUI.
_________________
All-in-One RuneScape Macro


Last edited by Stelimar on Fri Apr 04, 2008 12:40 am; edited 1 time in total
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Thu Apr 03, 2008 2:37 am    Post subject: Reply with quote

Nice!
You might find this usefull for your further development:
http://www.autohotkey.com/forum/topic20863.html
Back to top
Stelimar



Joined: 02 Apr 2008
Posts: 13

PostPosted: Thu Apr 03, 2008 2:49 am    Post subject: Reply with quote

Thanks for the link. I actually had the same exact idea for the random click/sleep to prevent the game detecting that it's a macro, since clicking several times in the exact same location is a bit suspicious...
_________________
All-in-One RuneScape Macro


Last edited by Stelimar on Fri Apr 04, 2008 12:40 am; edited 1 time in total
Back to top
View user's profile Send private message
Stelimar



Joined: 02 Apr 2008
Posts: 13

PostPosted: Fri Apr 04, 2008 12:19 am    Post subject: All-in-One RuneScape Macro Reply with quote

I've released version 0.6 of All-in-One RuneScape Macro, which you can get from th new small website I've set up here.

As before, if anyone has any feedback for new features, or things I could do to improve what I have already, it would be greatly appreciated.
_________________
All-in-One RuneScape Macro
Back to top
View user's profile Send private message
dartht33bagger



Joined: 16 Apr 2008
Posts: 4
Location: Oregon

PostPosted: Wed Apr 16, 2008 3:59 am    Post subject: Reply with quote

Nice, only reason to play runescape now. Nice work, website favourited.
Back to top
View user's profile Send private message
l0n3lyr0bot



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

PostPosted: Wed Apr 16, 2008 8:38 am    Post subject: air running Reply with quote

if you're thinking of making an air runner you could try my FindBank feature on my Runescape All-in-one Gui... Very Happy

_________________
-------------------------------------------------------


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





PostPosted: Sun Apr 20, 2008 3:51 pm    Post subject: Reply with quote

To prevent RuneScape detecting you are using this you should use random times
Back to top
dartht33bagger



Joined: 16 Apr 2008
Posts: 4
Location: Oregon

PostPosted: Sun Apr 20, 2008 7:39 pm    Post subject: Reply with quote

That feature is going to be put in on a later version of the macro.
_________________
www.360-hq.com
Back to top
View user's profile Send private message
Macrodeleter
Guest





PostPosted: Fri Aug 29, 2008 8:09 pm    Post subject: Deletion of Macro Reply with quote

I can't delete the Macro! Help if you know how to do this
Back to top
Display posts from previous:   
Post new topic   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