[Release] LazyPad script by Scorps1 menu

User Tag List

Results 1 to 5 of 5
  1. #1
    scorps1's Avatar Member
    Reputation
    2
    Join Date
    Sep 2012
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release] LazyPad script by Scorps1

    I can't use a keyboard to play games, but i am able to use a gamepad. So thats how this came about.

    Thanks to Tomatoes99 for ideas and inspiration. This was a re/learning experience for me as i have not done any coding for over 15 years and even then it was only a university course

    Suggestions for optimization and generalization are welcome, but i am too lazy to generalize this myself. sorry, too busy playing

    I have made many notes and comments in the script though so at least i have done that. They are pretty self-explanatory.

    So here goes:

    Code:
    ;-----------------------------------------------------------------------------
    ;+++ LAZYPAD 0.99 by SCORPS1 +++
    ;A lazy Guild Wars 2 auto-attack & loot script that is used with a gamepad
    ;Original code and ideas came from Tomatoes99 afk bot 1.0.6 script
    ;Combat mode or "xmode" ideas came from Combat Mode 1.1 by pvpproject
    ;Feel free to beg, borrow, or steal from this but please share and give credit
    ;Hopefully you learn something from this like i did from these guys
    ;-----------------------------------------------------------------------------
    ;Notes:
    ;Since this is a "lazy" script, please do not ask me to "generalize" it
    ;This script is made for my elementalist toon, may not work well with others
    ;This script is tailored for my window settings (windowed 1680x1010), so if
    ;  you change the $xres and $yres, you will need to recheck all Pixelsearches
    ;The "crosshair" is currently assuming a 7x7 white .bmp file in script dir
    ;Do not ask me any gamepad questions please,
    ;  for gamepad help please go to: http://wiki.guildwars2.com/wiki/User:Mighty
    ;-----------------------------------------------------------------------------
    ;In-game settings required:
    ;Autotargeting = on
    ;Promote skill target = off
    ;Fast-cast ground targeting = on
    ;Unbind TAB and make sure nothing is bound to 'next enemy' or 'nearest enemy'
    ;You will need to rebind Targetlock to 'L' in game
    ;-----------------------------------------------------------------------------
    ;Hotkeys (i map these plus many others to my gamepad):
    ;CAPSLOCK to "pause" script (starts in paused mode)
    ;TAB to toggle combat mode (xmode)
    ;F8/F9 switches my skills array up how i like it
    ;x to toggle target lockon/lockoff, so you dont have to hold the key down
    ;-----------------------------------------------------------------------------
    
    ;Settings and variables
    ;#RequireAdmin ;not really required unless you are having problems getting the script to work
    #include <WindowsConstants.au3> ;needed for GUI $WS_%%% commands
    Opt("SendCapslockMode", 0) ;1=store and restore, 0=don't (this is needed for CAPSLOCK toggle to work in my Windows installation)
    Global $skills[8]=["2", "3", "4", "5", "7", "8", "9", "0"] ;keys your skills are bound to (DON'T CHANGE THE NUMBER OF SKILLS UNLESS YOU KNOW WHAT YOU ARE DOING!)
    Global $Paused, $weapon=1, $xstate=0, $s=2, $xres=1680, $yres=1010, $rtime=110
    
    ;Hotkey settings
    Send("{CAPSLOCK off}") ;set capslock off before HotKeySet
    HotKeySet("{CAPSLOCK}", "TogglePause") ;set capslock as the toggle
    HotKeySet("{TAB}", "xmode")
    HotKeySet("{F8}", "scepter")
    HotKeySet("{F9}", "staff")
    HotKeySet("x", "targetlockon")
    
    ;;;; Body of program ;;;;
    Sleep(200)
    WinWait("Guild Wars 2") ;wait for gw2 window
    Sleep(700)
    checkwindow() ;size the window the way i like it
    Sleep(100)
    GUICreate("xhair", 7, 7, ($xres/2)-3, ($yres/2-85)-3, $WS_POPUP, $WS_EX_TOPMOST );+ $WS_EX_LAYERED) ;ex_layered makes the background transparent but impacts frame-rate so turned off right now
    GUISetBkColor(0xFFFFFF)
    GUICtrlCreatePic(@ScriptDir & "\crosshair1.bmp", 0, 0, 0, 0) ;right now the .bmp file is a white 7x7 square; easy to create yourself; did i mention this was a lazy script?
    TogglePause() ;start paused
    While 1
    	If WinActive("Guild Wars 2") Then
    		Send("1") ;start attack sequence
    		randsleep($rtime)
    		For $i = 0 To 7 Step 1 ;spam 8 random skills
    			randskill()
    		Next
    		PixelSearch(840, 908, 842, 910, 0xB51905, 15) ;check health and if below ~75% heal me
    		If @error Then
    			Send("6")
    		EndIf
    		randsleep($rtime)
    		PixelSearch(1105, 706, 1107, 708, 0x5A3802, 15) ;check for loot indicator at 1106,707
    		If Not @error Then
    			For $j = 0 to 2 Step 1
    				Send("f")
    				randsleep(60)
    			Next
    		EndIf
    	EndIf
    WEnd
    ;;;;;;;;
    
    Func checkwindow()  ;check window size and fix if necessary
    	Local $size = WinGetPos("Guild Wars 2")
        If $size[0]=0 and $size[1]=0 and $size[2]=$xres and $size[3]=$yres Then
    		Return
    		Else
    			WinMove("Guild Wars 2","",0,0,$xres,$yres)
    	EndIf
    EndFunc ; >checkwindow
    
    Func TogglePause() ;umm this is TogglePause  :)
    	$Paused = Not $Paused
    	While $Paused
    		Sleep(100)
    		ToolTip('Script is "Paused"', 0, 0)
        WEnd
        If $weapon=1 Then
    		ToolTip("Scepter", 110, 0)
        ElseIf $weapon=2 Then
    		ToolTip("Staff", 110, 0)
        Else
    		ToolTip("")
        EndIf
    EndFunc ; >TogglePause
    
    Func RandSkill()  ;choose random skill from $skills
    	$s=$skills[Random(0,7,1)]
    	Send($s)
    	randsleep($rtime)
    EndFunc ; >RandSkill
    
    Func RandSleep($ms) ;Sleeps + or - 20% of amount
    	Sleep($ms*Random(.80,1.2))
    EndFunc ; >RandSleep
    
    Func scepter() ;skills array with scepter-dagger
    	$skills[2]="4"
    	$weapon=1
    	ToolTip("Scepter", 110, 0)
    EndFunc ; >scepter
    
    Func staff() ;skills array for staff
    	$skills[2]="2"
    	$weapon=2
    	ToolTip("Staff", 110, 0)
    EndFunc ; >staff
    
    Func targetlockon() ;targetlock on
    	sleep(20)
    	send("{l down}")
    	sleep(100)
    	HotKeySet("x", "targetlockoff")
    EndFunc ; >targetlock on
    
    Func targetlockoff() ;targetlock off
    	sleep(20)
    	send("{l up}")
    	sleep(100)
    	HotKeySet("x", "targetlockon")
    EndFunc ; >targetlock off
    
    Func xmode()  ;sometimes i find it that it doesn't work 100% on the 1st try; any suggestions will help me here
    	If $xstate=0 Then
    		$xstate=1
    ;~ 		BlockInput(1) ;don't think this command is working and probably is not even necessary
    		MouseMove($xres/2-10, $yres/2-85, 1) ;move mouse near crosshair position
    		MouseDown("right")
    		sleep(20)
    		MouseMove($xres/2, $yres/2-85, 1) ;need to move mouse after mousedown event so that camera look will kick in
    ;~ 		BlockInput(0) ;don't think this command is working and probably is not even necessary
    		sleep(20)
    		GUISetState(@SW_SHOW)
    		WinActivate("Guild Wars 2")
    		Sleep(100)
    	Else
    		$xstate=0
    		MouseUp("right")
    		GUISetState(@SW_HIDE)
    	EndIf
    EndFunc	; >xmode

    [Release] LazyPad script by Scorps1
  2. #2
    scorps1's Avatar Member
    Reputation
    2
    Join Date
    Sep 2012
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    reserved space.

  3. #3
    Tomatoes99's Avatar Sergeant CoreCoins Purchaser
    Reputation
    16
    Join Date
    Aug 2012
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey I already posted this in my thread, but thanks so much for releasing this! This is exactly what I wanted to see when I released my script; people using it and expanding upon it. There's some good work here, nice job scorps.

  4. #4
    Lashley93's Avatar Member
    Reputation
    2
    Join Date
    Dec 2010
    Posts
    61
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im useless with stuff like this, how do I use this? thanks for your time

  5. #5
    Tomatoes99's Avatar Sergeant CoreCoins Purchaser
    Reputation
    16
    Join Date
    Aug 2012
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Lashley93 View Post
    im useless with stuff like this, how do I use this? thanks for your time
    read my post and use my instructions with scorps' script.

Similar Threads

  1. [Release] Custom scripts
    By ion564 in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 05-12-2008, 07:02 PM
  2. [Release] WarsongGulch Script
    By Pragma in forum World of Warcraft Emulator Servers
    Replies: 33
    Last Post: 03-23-2008, 08:07 PM
  3. [Release] |Custom Scripted Instance| Shadow Lair
    By wurstbr0t in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-05-2008, 12:03 PM
  4. [RELEASE]Ascent/script compiles 3710 (latest 2/6/08)
    By vivec45 in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 02-06-2008, 07:04 AM
  5. [RELEASE] FunServer Script's ( + Level Cap 80-255 )
    By ~SaiLyn~ in forum World of Warcraft Emulator Servers
    Replies: 36
    Last Post: 01-10-2008, 02:44 PM
All times are GMT -5. The time now is 04:11 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search