[EasyUO] Recall Script

If you make a Client-side script you can publish it here for other players to use
Post Reply
Blade Slinger
Apprentice Scribe
Posts: 17
Joined: Tue Mar 23, 2010 6:11 pm

[EasyUO] Recall Script

Post by Blade Slinger »

After seeing people jump around from spawn to spawn I decided there must be good money in it or something. It was obvious people were using a script of some type. I looked but didn't find a script that would do this so I set out to create one and share it here on the forums. This script is the result of only a couple days work. I didn't even know about easyuo until a couple weeks ago when I was looking for a way to do fast healing. That's when I found Blazin Healer which works great. I recommend using it as it works so well and this script does not attempt to do any healing.

This script is written with the mindset of using a bladed weapon however a bow should also work just fine. It will recall to each spot in your "money book" look for the creature you set for that spot and attack it until all in the area are dead. It will attempt to claim them as well. When it gets to a new spot it looks for other players first. If it finds one it simply recalls to the next spot to keep from kill stealing. It also will use chivalry spells to cast enemy of one as well as divine fury when stamina is 50 less the max you set. It will also cast consecrate weapon every 10 seconds to keep damage output up. That's basically all it does other than when you get over the weight limit you set it will recall to your "bank book" and attempt to drop gold into an Exex box. I recommend marking a rune one tile away from the box and setting it as your default rune in a runebook. It simply recalls off of that book and does not look for runes in the money book. It will prompt you for the money runebook, bank runebook as well as the exex box and will show you the id for each one. You can select each one every time you start the script or you can type them into the script when it shows it to you and save it so it will not prompt you each time which is what I recommend.

This script is by far not a polished thing. There is a massive amount of room for improvement. Maybe some of the folks here will help improve it and polish it into a great script that everyone can use.

This does require a few minutes and a little effort on your part to setup. First setting the id of each of the books and exex box as stated above. You also should set your stamina and weight of your character. You can set the recall spell type as well. If your spell casing is not maxed out speed you can use magery and cast protection to keep from fizzle when you get hit. You should set the primary or secondary ability to use with the weapon you plan to use. This is primarily coded to use whirlwind as it looks for other creatures 1 tile away from you and if there are more than one then it sets the special. The longest part of the process is setting the creature types. I used Tecmo's Creature ID script and it worked great to get the types. Simply run it and attack something and it will show you the type. Each rune 1 to 16 is listed. All you have to do is put the types of creatures you want to attack at that rune spot in the book on each line separated by a _ . That's the creatures it will look for at attack until all are dead or you are dead in the area. There is a money book rune count setting so that you can chose to only use a few runes or all 16 in the book. It will always start at the first rune. I recommend getting a new book and going to the spots you want to recall into and mark runes in the order you want. While you are there use Tecmo's script and get the id of what you want to kill and add it to the script as you go. It doesn't take long setup a book like this.

Keep in mind when marking your spots. This script will not open doors and such things. Try to pick a spot that is kind of open or has your target spawn near by so that it can get to the spawn. If it can't get to the spawn for some reason it will simply recall to the next spot.

This script is not really designed to run AFK as there are no real defense coded in and may get confused or stuck from time to time and need user intervention. I do not condone AFK scripting to gather resources and it's also against the rules. Use at your own risk. If you get caught running this AFK it's your fault.


Temco's Creature ID script

Code: Select all

    ; ========================================
    ; Name: Tecmo's Creature ID (c)
    ; Author: Tecmo
    ; Version 1.02
    ; Client Tested with: (need verification)
    ; Revision Date: August 26, 2003
    ; Public Release: June 15, 2003
    ; Purpose: Creature ID Obtaining Assistant
     
    InitEvents
    ; ========================================
    ; INSTRUCTIONS
    ; ========================================
    ; For use when looking for Creature ID's
    ; Attack any type of creature and the Creature Type will be displayed.
    ; This type can be used for searching for creatures. ( #findtype )
    ; PRESS PLAY !
    ; ========================================
     
     
            if #mana = N/A 2
                    event macro 8 2
                    wait 20
            menu window title Tecmo's Creature ID
            menu window size 200 25
            menu hide
            menu clear
            menu window color btnface
            menu text stat 5 4 Creature Type :
            menu show
            set %1 sc
     
    loop:
            if #enemyid <> N/A 6
                    finditem #enemyid
                    if #findtype <> X 4
                            if #findtype <> %1 3
                                    menu delete text14
                                    menu text text14 100 3 #findtype
                                    set %1 #findtype
    goto loop
    ;End of File!
    
The recall script.

Code: Select all


set %MoneyBookID XXXXXX ; id of your money book
set %MoneyBookRuneCount 12 ; number of runes in money book 1 to 16
set %BankBookID XXXXXX ; id of your book to recall next to an exex box
set %maxStamina 263 ; maximum stamina of your character
set %maxWeight 450 ; max weight your character can hold (over this will drop gold)
set %ExexBox XXXXXX ; id of the exex box to drop gold into

set %RecallSpellType sacred ; recall gate or sacred (recall type)
set %use_special 1 ;0 for none, 1 for primary 2 for secondary 
set %forceSpecial #false ; #false for whirlwind, #true forces special to be used as often as possible
set %MaxRange 18 ; range to look for creatures (how many tiles around you to look: max is 18 tiles)
set %claimCorpses claim ; claim / claimAll / noClaim (will not attempt to claim)
set %discord #true ; #true will discord your target if you have an instrument 


; set each type at each rune location in your book seperated by a _
; make sure there is a space before the first type. : example set %Creature_List1 XX_XX
SET %Creature_List1 
SET %Creature_List2 
SET %Creature_List3   
SET %Creature_List4  
SET %Creature_List5  
SET %Creature_List6   
SET %Creature_List7   
SET %Creature_List8  
SET %Creature_List9 
SET %Creature_List10 
SET %Creature_List11 
SET %Creature_List12 
SET %Creature_List13  
SET %Creature_List14 
SET %Creature_List15  
SET %Creature_List16  

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;                     ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;   END OF SETTINGS   ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;                     ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


; Check to see if ID's are set
if %MoneyBookID = XXXXXX
{
	GoSub GetMoneyRunebook
	display ok This is the ID of your Money book.$Set in script to keep from having to select it each time.$$ %MoneyBookID
}
if %BankBookID = XXXXXX
{
	GoSub GetBankRunebook
	display ok This is the ID of your Bank book.$Set in script to keep from having to select it each time.$$ %BankBookID
}
if %ExexBox = XXXXXX
{
	GoSub GetExexBox
	display ok This is the ID of your Exex box.$Set in script to keep from having to select it each time.$$ %ExexBox
}



set %claimCorpseIdList
set %current_rune 1
set %consecrate 0
set %discordTime 0
set %specialTimer 0
set %discorded
loop_start:

; if overweight drop gold off
if #weight > %MaxWeight
	gosub drop_gold


; MAIN LOOP
gosub recallMoney
; reset ignore list for corpses at last location 
ignoreItem reset 1
set %claimCorpseIdList
set %discorded
; look for other players
FindItem IS_HS_ G_ , %MaxRange
; if other players
	if #findCnt > 1 
		goto loop_start	
		
; no other players
; look for creature to attack
loop_enemy:
	FindItem %Creature_List . %current_rune G_12
	; if creature not found recall to next spot
		if #FindKind <> -1		
		{
			; attack creature				
			event macro 15 206
			wait 5	
			
			gosub Attack
			goto loop_enemy:
		}		
		wait 1
; }
goto loop_start



Sub Attack
{
loop_attack:
	
	if %discord = #true
	{
		finditem QRF_NRF_MQF_PRF_LQF_OQF_PGP #backPackID
		if #findCnt > 0		
			set %discordInst #findId		
		else
			set %discordInst #false
	}
	
	
	set %range 1
	while %range <= %MaxRange
	{		
		FindItem %Creature_List . %current_rune G_ , %range		
		if #findcnt > 0
		{
			set #LTargetID #findID
			set %enemy #findID
			set %enemyX #findx
			set %enemyY #findy
			set %enemyZ #findz
			set %enemyDist #findDist
			set %currentRange %range
			set %range %MaxRange			
		}
		set %range %range + 1
	}
	
	if #findKind <> -1 
	{	
		if %enemyDist > 0
			event PathFind %enemyX %enemyY %enemyZ
		
		set %jStart #jindex		
		set %timeexpire #time + 1 ; wait for 1 sec for a server response		
		while #jindex = %jStart ; wait for response from server.
		{
			if #time > %timeexpire						 
				break			
		}
		set %jEnd #jIndex
		for %i %jStart %jEnd
		{
			 scanjournal %i
			 if get_there in #journal
			 {
					goto loop_start
			 }
		}
		wait 1			
		; attack last target 
		event macro 27
		
		if %use_special > 0 && #sCnt > %specialTimer
		{	
			set %specialTimer #sCnt + 1
			if %forceSpecial = #false
			{
				FindItem %Creature_List . %current_rune G_2			
				if #findRep > 2 && #findRep < 7
				{
					if #findCnt > 1
					{
						; whirlwind
						if %use_special = 1
							event macro 35 0
						if %use_special = 2
							event macro 36 0
						set #LTargetID #findID
						event macro 27						
					}
				}
			}
			if %forceSpecial = #true
			{
				if %use_special = 1
					event macro 35 0
				if %use_special = 2
					event macro 36 0
				set #LTargetID #findID
				event macro 27				
			} 
		}
		
			
		; check if 10 seconds have passed. 
		if #sCnt > %consecrate
		{ 		
			event macro 15 203 ; cast consecrate weapon			
			set %consecrate #sCnt + 9 ; wait 10 seconds to cast again
		} 			
		
		if %discord = #true
		{
			if #findId in %discorded
				goto discord_end
			if #sCnt > %discordTime
			{
				set %discordTime #sCnt + 1
				If %discordInst <> #false
				{	
					set %jStart #jindex
					set #LObjectId %discordInst
					set #LTargetId #findId
					event macro 17 0
					wait 1
					event macro 13 15
					set %timeexpire #time + 1 ; wait for 1 sec for a server response					
					while #jindex = %jStart ; wait for response from server.
					{ 
						if #time > %timeexpire
							break						
					}
					set %jEnd #jIndex
					for %i %jStart %jEnd
					{
					 scanjournal %i												 
					 if you_must_wait in #journal
					 {
							key ESC
							goto discord_end
					 }						
					}				
					target 1s
					set %jStart #jindex
					event macro 22 0
					set %timeexpire #time + 2					
					while #jindex = %jStart ; wait for response from server.
					{  
						if #time > %timeexpire
							break						
					}
					set %jEnd #jIndex
					for %i %jStart %jEnd
					{
					scanjournal %i 
					if play_jarring_music in #journal					 
					set %discorded %discorded , _ , #findId
					}					
					; wait 10
				}					
			}
		}
    discord_end:
		
		if #stamina < %maxStamina - 50
		{	
			wait 10 
			; cast Divine Fury
			event macro 15 205
		}

		
		if %claimCorpses <> noclaim
			gosub claimCorpses
		
		goto loop_attack 
	
	} 
	else 
	{
		return 
	}
	
goto loop_attack
}
return 


sub claimCorpses
{
loop_corpse:
	finditem YFM G_ , %MaxRange
	if #findCnt = 0
	{    
    key ESC	; cancel target
    return
  }
		
	if #findid in %claimCorpseIdList	
		ignoreItem #findid 1
	else
  {
		set %claimCorpseIdList %claimCorpseIdList , _ , #findID
    set #LTargetID #FindID
		if %claimCorpses = claim		
			event macro 1 0 [claim
		if %claimCorpses = claimall
			event macro 1 0 [claimall
		event macro 25 0
		wait 1
		event macro 22 0
		
		set %jStart #jindex		
		set %timeexpire #time + 1 ; wait for 1 sec for a server response		
		while #jindex = %jStart ; wait for response from server.
		{
			if #time > %timeexpire						 
				break			
		}
		set %jEnd #jIndex
		for %i %jStart %jEnd
		{
			scanjournal %i
			if too_far_away in #journal || earn_the_right in #journal || be_seen in #journal
				set %claimCorpseIdList %claimCorpseIdList , _ , #findID			
		}
		
  }

	goto loop_corpse	
}


SUB GetMoneyRunebook
display ok Please target your money making spots runebook.
wait 5
event macro 13 1
set #LTARGETID #CHARID
wait 2s
loop_checkmoneyrunebook:
wait 5
if #LTARGETID <> #CHARID
{
        set %MoneyBookID #LTARGETID       
        return
}
GOTO loop_checkmoneyrunebook:
return


SUB GetBankRunebook
display ok Please target your bank runebook.
wait 5
event macro 13 1
set #LTARGETID #CHARID
wait 2s
loop_checkbankrunebook:
wait 5
if #LTARGETID <> #CHARID
{
        set %BankBookID #LTARGETID        
        return
}
GOTO loop_checkbankrunebook:
return

SUB GetExexBox
display ok Please target your Exex box.
wait 5
event macro 13 1
set #LTARGETID #CHARID
wait 2s
loop_checkexexbox:
wait 5
if #LTARGETID <> #CHARID
{
        set %ExexBox #LTARGETID        
        return
}
GOTO loop_checkexexbox:
return






; function recall
sub recallMoney
{
	if #weight >= #maxWeight
	{
; 	if weight is over limit
; 		recall to bank and put gold in bank
	} 
; 		recall to next spot





	; Sub NextSpot
	;wait 1s
	set %current_rune %current_rune + 1
	if %current_rune > %MoneyBookRuneCount
					set %current_rune 1
	set %lcharposx #CHARPOSX
	set %lcharposy #CHARPOSY
	;wait 1s
	loop_nextSpot:	
	Gosub runeBook %MoneyBookID %current_rune %RecallSpellType
	wait 1s
	;-------------------------------------------------------------------------------------------------------------------------------------------------
	;Checks if recall was sucessfull
	if %lcharposx = #CHARPOSX && %lcharposy = #CHARPOSY
	{
					Event sysmessage Recall was unsucessfull
					Set %skipsearch #TRUE
					; wait 3s
					GOTO loop_nextSpot
	}
Return
}



; BlaZin' Runebook
; by BlaZe Budd of Excelsior's ßud ßrothers
; v1.0 completed 2/21/09
sub runeBook
; ignoreitem reset
set %runeBook %1
set %spot %2
set %method %3
set #LOBJECTID %runeBook
gosub spot
gosub cast %runeBook
return
;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Find and open the runebook ;;;
sub openBook
bookLoop:
set #LOBJECTID %1 ; %runeBook
event macro 17 0
; gosub waitForBook
set %timeexpire #time + 1
waitOnBook:
;if pass in #result
if #contSize = 452_236
{
	
  return
}
else
{
	if #time > %timeexpire
	{
		; book didn't open for some reason after 1 second try again
		goto bookLoop 
	}
	else
	{
		goto waitOnBook
	}
	
	
}
goto bookLoop
;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Waits for runebook to open ;;;
sub waitForBook
loop:
; gosub journal You_must_wait
;if #result = fail
;  return
if #contSize = 452_236
  return pass
goto loop
;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Choosing the selected spot ;;;
sub pageFlippin
savepix ( #contposX + 135 ) ( #contPosY + 25 ) 1
set %Y #contPosY + 200
if %page = 1
  set %X #contPosX + 140
if %page = 2
  set %X #contPosX + 175
if %page = 3
  set %X #contPosX + 210
if %page = 4
  set %X #contPosX + 245
if %page = 5
  set %X #contPosX + 310
if %page = 6
  set %X #contPosX + 345
if %page = 7
  set %X #contPosX + 380
if %page = 8
  set %X #contPosX + 415
click %X %Y
flip:
cmpPix 1 t
  goto flip
set %Y #contPosY + 25
if %side = left
  set %X #contPosX + 165
if %side = right
  set %X #contPosX + 305
click %X %Y
gosub waitForBook
click %X %Y r
return
;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Casting ;;;
sub cast
if recall in %method
  event macro 1 0 [cs recall
if gate in %method
  event macro 1 0 [cs gatetravel
if sacred in %method
  event macro 1 0 [cs sacredjourney
gosub openBook %1
gosub pageFlippin
wait 1
finditem %runeBook C_ , #backPackID
set #lTargetID #findID
set #lTargetKind 1

target
event macro 22 0
return
;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Setting %side and %page ;;;
sub spot
if %spot = 1
  set %page 1
if %spot = 3
  set %page 2
if %spot = 5
  set %page 3
if %spot = 7
  set %page 4
if %spot = 9
  set %page 5
if %spot = 11
  set %page 6
if %spot = 13
  set %page 7
if %spot = 15
  set %page 8
set %side left
if %spot = 2
  set %page 1
if %spot = 4
  set %page 2
if %spot = 6
  set %page 3
if %spot = 8
  set %page 4
if %spot = 10
  set %page 5
if %spot = 12
  set %page 6
if %spot = 14
  set %page 7
if %spot = 16
  set %page 8
if %spot / 2 = %page
  set %side right
return
;;;;;;;;;;;;;;;;;;;;;;;;;



sub drop_gold
{		
loop_recall_to_bank:
	if recall in %RecallSpellType
  event macro 1 0 [cs recall
	if gate in %RecallSpellType
		event macro 1 0 [cs gatetravel
	if sacred in %RecallSpellType
		event macro 1 0 [cs sacredjourney
	
	finditem %BankBookID C_ , #backPackID
	set #lTargetID #findID
	set #lTargetKind 1
	set %lcharposx #CHARPOSX
	set %lcharposy #CHARPOSY
	
	target
	; event macro 25 0
	event macro 22 0
	wait 1s
	;-------------------------------------------------------------------------------------------------------------------------------------------------
	;Checks if recall was sucessfull
	if %lcharposx = #CHARPOSX && %lcharposy = #CHARPOSY
	{
					Event sysmessage Recall was unsucessfull
					Set %skipsearch #TRUE
					; wait 3s
					GOTO loop_recall_to_bank
	}
	
loop_drop_gold:
	finditem POF C_ , #backPackID
	if #findid = X
		return
	exevent Drag #findID #findstack
	wait 10
	exevent Dropc %ExexBox
	wait 10
	goto loop_drop_gold

}


Last edited by Blade Slinger on Sat Jan 08, 2022 4:15 pm, edited 9 times in total.
User avatar
Matrix
Legendary Scribe
Posts: 271
Joined: Sun Mar 08, 2020 5:57 pm

Re: [EasyUO] Recall Script

Post by Matrix »

Thanks.
Please reply to me:
in-game: [pm Matrix
discord id: Matrixre
(Only checking the forums monthly)
(All prices can be change, ED to Gold to ED)
deckard*
Journeyman Scribe
Posts: 24
Joined: Mon Oct 11, 2021 6:20 pm

Re: [EasyUO] Recall Script

Post by deckard* »

Great script.

Unfortunatelly, the "set %use_special" to 1 or 2 didn't work for me, so special abilities primary or secondary are not spamming at all, not even whirlwind.

Is there a way to fix it and make the abilities spam correctly at each hit?

Thank you
Blade Slinger
Apprentice Scribe
Posts: 17
Joined: Tue Mar 23, 2010 6:11 pm

Re: [EasyUO] Recall Script

Post by Blade Slinger »

deckard* wrote:
Tue Dec 21, 2021 9:07 pm
Is there a way to fix it and make the abilities spam correctly at each hit?
It is setup to use whirlwind, so if more than one 1 of the target creatures is 1 tile away from you it will use it.

However, you should be able to change the use special code on line 141 to remove the check if creature is close and instead just fire the selected special every time.

Like this.

Code: Select all

		if %use_special > 0
		{
			if %use_special = 1
				event macro 35 0
			if %use_special = 2
				event macro 36 0
			set #LTargetID #findID
			event macro 27
			wait 15
		}
deckard*
Journeyman Scribe
Posts: 24
Joined: Mon Oct 11, 2021 6:20 pm

Re: [EasyUO] Recall Script

Post by deckard* »

Thank you. It works perfectly. It's a masterpiece.
Zanzi
Elder Scribe
Posts: 139
Joined: Mon Mar 08, 2021 12:20 am

Re: [EasyUO] Recall Script

Post by Zanzi »

I did everything as suggested with the set up. When I run script, it open rune book, then cast sacred journey, then has a target (gump?), and that is it. The script does not do anything else. Any suggestions?
Blade Slinger
Apprentice Scribe
Posts: 17
Joined: Tue Mar 23, 2010 6:11 pm

Re: [EasyUO] Recall Script

Post by Blade Slinger »

I have updated the script with some new options due to request being made. One is the ability to force a special to be used as often as possible instead of just for whirlwind when more than one target creature is 1 tile away. If the force special option is set to #true it will try to use the special selected (1 or 2) each time.

I have also updated the claim part of the script. It will no longer hang up the script if you encounter a corpse you can't claim for some reason. It will now attempt to claim the corpse two times. If the second time fails it will be ignored so the script can continue. The ignore list is reset after each recall so by the time you come back to that spot you may be able to claim it and it will attempt to claim it again.

I also added the ability to either claim, claim all, or don't claim anything.

Thanks to Zanzi for helping test the claim part of the script.
Blade Slinger
Apprentice Scribe
Posts: 17
Joined: Tue Mar 23, 2010 6:11 pm

Re: [EasyUO] Recall Script

Post by Blade Slinger »

I have also just updated the script to use discord on your target if you have an instrument in your backpack. You can turn this off by setting %discord to #false in the settings.
Blade Slinger
Apprentice Scribe
Posts: 17
Joined: Tue Mar 23, 2010 6:11 pm

Re: [EasyUO] Recall Script

Post by Blade Slinger »

I updated the script again. Discord should work faster on your target now.
Post Reply