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
Goto page 1, 2  Next
 
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: 10

PostPosted: Wed Apr 02, 2008 11:00 pm    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 Thu Apr 03, 2008 11:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Thu Apr 03, 2008 1: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: 10

PostPosted: Thu Apr 03, 2008 1: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 Thu Apr 03, 2008 11:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
Stelimar



Joined: 02 Apr 2008
Posts: 10

PostPosted: Thu Apr 03, 2008 11:19 pm    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 2: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 7: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 2: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 6: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 7: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
yo
Guest





PostPosted: Wed Oct 29, 2008 11:09 pm    Post subject: Reply with quote

how do i paste the script and where do i paste it i see it on the clip board but dont no wat to do from here plz help...
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 923
Location: Canada

PostPosted: Fri Oct 31, 2008 2:22 am    Post subject: Reply with quote

I noticed your all conserned about them noticing the macro. Dont worry about XY coord they can't pick them up exactly (too much memory needed to do that) however the time of clicks may be recorded after some suspision in made.

For auto typer I have a list method that does something like this,,,


"Buying Lobbys 200 Each"
"Buying Lovbys 200 Each"
"Buying Lobbys 200 Eac"
"Buyng Lobbys 200 Each"
... Ect

I use a random function. If you have about 10 of these it's rather hard to be detected. Especialy with random Mouse.
_________________

I know i have 6 legs. It's cuz I'm special.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Guest






PostPosted: Sat Nov 01, 2008 5:07 pm    Post subject: Reply with quote

I'm not at home at the moment, but I wrote a sweet Highscores look-up that looks almost exactly like the Runescape highscores page. I'll share it when I get home.

It detects a change in the persons XP and levels since the last check, shows how much XP they need until they reach their next level, shows which skills they are close to upping (By 95% of the needed XP being gained), and shows rank as a tooltip when you click their skill, shows their combat level and what they need to level up again (For members and free to play).

I was actually asked to make it by Tip.It, for those who know / use it.
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 923
Location: Canada

PostPosted: Sun Nov 02, 2008 11:07 am    Post subject: Reply with quote

Heres my Highscore look up

Code:

InputBox, username, User Name, Please enter a user name.,,
if ErrorLevel
   Return
else 
{    url=http://hiscore.runescape.com/index_lite.ws?player=%username%
    UrlDownloadToFile,%url%, %WinDir%\TEMP\Hiscores.tmp
}
FileReadLine, 2, %WinDir%\TEMP\Hiscores.tmp, 2
if 2 is Alpha
{
Gui, 2:Add, text, x35 y10 h20, "%username%" is an UnRanked User
Gui, 2:Add, Button, x5 y40 w100 h20, Return
Gui, 2:Add, Button, x105 y40 w100 h20, Exit
Gui, 2:Show, w220
Return,
}

Loop, 90
{
FileReadLine, %A_Index%, %WinDir%\TEMP\Hiscores.tmp, %A_Index%
}

SKILLS:= "Overall,Attack,Defence,Strength,Hitpoints,Ranged,Prayer,Magic,Cooking,Woodcutting,Fletching,Fishing,Firemaking,Crafting,Smithing,Mining,Herblore,Agility,Thieving,Slayer,Farming,Runecraft,Hunter,Construction,Summoning"

StringSplit, Skill, SKILLS, `,
FileRead, Con, %WinDir%\TEMP\Hiscores.tmp
StringSplit, X, Con, `n

Gui, Add, ListView, x5 y5 w300 h250, Skill              |Rank         |Level       |XP

Loop 25 {
   StringSplit, L, X%A_Index%, `,
   LV_Add("", Skill%A_Index%,  L1, L2, L3)
}
Gui, Add, Button, x5 y270 w150 h20, Return
Gui, Add, Button, x155 y270 w150 h20, Exit
Gui, Show, w310 h300, %username%'s highscores
Return,

ButtonExit:
2ButtonExit:
{
ExitApp,
Return,
}

ButtonReturn:
2ButtonReturn:
{
Reload,
Return,
}

_________________

I know i have 6 legs. It's cuz I'm special.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Banned - Yes/No?
Guest





PostPosted: Fri Nov 07, 2008 11:21 pm    Post subject: Reply with quote

Anybody ever get banned using this? All I'm interested in is simple autoclicking as its hard to move my mouse I use, and using this would be much easier than me basically recreating the same exact random pixel click/sleep.. so?

Oh another note: How do you insert functions into an ahk script.. ? Like if I were to create my own autoclicker, I'd use some of the functions listed in Z GECKO's topic.. but it says I have to "incorporate them into my own script" - how??
Back to top
DaveNate
Guest





PostPosted: Mon Nov 17, 2008 2:20 pm    Post subject: MacroDetection Reply with quote

Not even sure why this would be a problem, there are enough randomn events and screen change positions to frustrate even the most skilled programmer. You still have to be present or else risk destroying your tool, getting killed by randomn spawn. Swarm, poisonous gas, tree spirit. Basically, all we are doing is saving ourselves carpel tunnel syndrome.

At any rate, the click time should not matter at all. Internet traffic (i.e. Ping Times) will create plenty of randomness for when the Runescape Server actually gets the mouse commands.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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