Advertisement
cameronza

AHK Functions for OSRS

Jan 25th, 2016 (edited)
2,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Misc. Functions that can be implemented into any scripts of your liking, used by myself.
  2. ; Contact me - Discord/RSN: Jiklim | Twitter: @JiklimRS_
  3. ; If you have any other useful functions that can be used in AHK scripts for runescape, then i'll add it here.
  4.  
  5. F1:: Suspend,toggle ; Used to add a toggle-able button to suspend your AHK script.
  6. return
  7.  
  8. SingleInstance FORCE ; Forces there to be only one instance of the script running.
  9.  
  10. ; To use scripts only on specific clients, add the following:
  11. #IfWinActive ahk_class SunAwtFrame
  12.  
  13. ; If you want to make a timer and play a sound to alert you when something is finished (like smelting cannonballs) you can do it like this (From reddit/u/DontThrowAwayTreees)
  14. CBallsNotification:
  15. SoundPlay, cballs_done.mp3
  16. return
  17.  
  18. ; Pressing 'F2' sets a timer which will run only once (because of the - sign) after 154 seconds, which then executes the CBallsNotification-part. This part will play the cballs_done.mp3-file which is located in the same folder as your script.
  19. F2:: SetTimer, CBallsNotification, -154000
  20. return
  21.  
  22. ; A toggleable shift key, useful for when the Shift key needs to be held down.
  23. LShift::
  24.     if GetKeyState("LShift") ; LShift is logically down. Release it.
  25.         Send {Blind}{LShift Up}
  26.     else ; LShift is logically up. Press it.
  27.         Send {Blind}{LShift Down}
  28. return
  29.  
  30. ;Makes OSRS client borderless, moves the client to top left of main monitor, and resizes to borderless dimensions.
  31. F12::
  32. WinSet, Style, -0x00400000L, A
  33. WinSet, Style, -0x800000, A
  34. WinSet, Style, -0x40000, A
  35. WinMove, A, , 0, 0, 765, 503
  36. return
  37.  
  38. ;Removes Vanilla OSRS Client borders.
  39. F11::
  40. WinSet, Style, -0x00400000L, A
  41. WinSet, Style, -0x800000, A
  42. WinSet, Style, -0x40000, A
  43. return
  44.  
  45. ;Adds Vanilla OSRS Client borders.
  46. F10::
  47. WinSet, Style, +0x00400000L, A
  48. WinSet, Style, +0x800000, A
  49. WinSet, Style, +0x40000, A
  50. return
  51.  
  52. ;Moves the client to top left of main monitor, and resizes it to bordered dimensions.
  53. F9::
  54. WinMove, A, , 0, 0, 781, 543
  55. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement