AutoHotkey Community

It is currently May 26th, 2012, 11:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: April 3rd, 2008, 12:00 am 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
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 April 4th, 2008, 12:40 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 2:37 am 
Nice!
You might find this usefull for your further development:
http://www.autohotkey.com/forum/topic20863.html


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2008, 2:49 am 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
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 April 4th, 2008, 12:40 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 4th, 2008, 12:19 am 
Offline

Joined: April 2nd, 2008, 11:30 pm
Posts: 10
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 16th, 2008, 3:59 am 
Offline

Joined: April 16th, 2008, 3:54 am
Posts: 4
Location: Oregon
Nice, only reason to play runescape now. Nice work, website favourited.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: air running
PostPosted: April 16th, 2008, 8:38 am 
Offline

Joined: April 15th, 2008, 9:29 pm
Posts: 3
Location: Falling through time
if you're thinking of making an air runner you could try my FindBank feature on my Runescape All-in-one Gui... :D
Image

_________________
-------------------------------------------------------
Image

I am a squid.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2008, 3:51 pm 
To prevent RuneScape detecting you are using this you should use random times


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 20th, 2008, 7:39 pm 
Offline

Joined: April 16th, 2008, 3:54 am
Posts: 4
Location: Oregon
That feature is going to be put in on a later version of the macro.

_________________
http://www.360-hq.com
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Deletion of Macro
PostPosted: August 29th, 2008, 8:09 pm 
I can't delete the Macro! Help if you know how to do this


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2008, 12:09 am 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2008, 3:22 am 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
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.

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2008, 6:07 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2008, 12:07 pm 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
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,
}

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 8th, 2008, 12:21 am 
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??


Report this post
Top
  
Reply with quote  
 Post subject: MacroDetection
PostPosted: November 17th, 2008, 3:20 pm 
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.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group