help to fix this macro

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Post Reply
Message
Author
MiDaM
Human
Human
Posts: 35
Joined: 20 Jan 2010, 09:07
Noob?: Yes

help to fix this macro

#1 Post by MiDaM »

Hello, anyone can help me to fix ?
I have this error http://prntscr.com/kyq40a

Code: Select all

#_______________________________________________________________#
# 										  						
# KAFRA SAVEPOINTS      	  							
#   															
# NOTICE : Set 0 or 1 to disable/enable autostorage or autosell			
#		   in $storageOption/$sellOption									
#_______________________________________________________________#

automacro KafraSavePoints {
	InMap prt_fild05, prontera, geffen, aldebaran, payon, morocc, alberta
	exclusive 1
	run-once 1
	macro_delay 3
	call ChangeSavePoints
}

macro ChangeSavePoints {	
	$storageOption = 1 
	$sellOption = 1
	$successLog = KafraSavePoints: saveMap was set
	$errorLog = KafraSavePoints: saveMap was already set!	
	switch ($.InMapLast) {
		case (== prt_fild05) {
			if (&config (saveMap) != prt_fild05) {
				do ai manual
				do move prt_fild05 &rand(284,288) &rand(219,222)
				do talknpc 290 224 c r0 n
				[	
					do conf saveMap prt_fild05
					do conf storageAuto $storageOption
					do conf storageAuto_npc prt_fild05 290 224
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(260,280)
					do conf autoMoveOnDeath_y &rand(200,220)
					do conf autoMoveOnDeath_map prt_fild05
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc prt_fild05 290 221 
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
		case (== prontera) {
			if (&config (saveMap) != prontera) {
				do ai manual
				do move prontera &rand(145,149) &rand(23,27)
				do talknpc 151 29 c r0 n
				[
					do conf saveMap prontera
					do conf storageAuto $storageOption
					do conf storageAuto_npc prontera 151 29
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(120,140)
					do conf autoMoveOnDeath_y &rand(10,25)
					do conf autoMoveOnDeath_map prontera
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc prt_in 126 76  
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
		case (== geffen) {
			if (&config (saveMap) != geffen) {
				do ai manual
				do move geffen &rand(114,118) &rand(56,60)
				do talknpc 120 62 c r0 n
				[
					do conf saveMap geffen
					do conf storageAuto $storageOption
					do conf storageAuto_npc geffen 120 62
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(90,110)
					do conf autoMoveOnDeath_y &rand(30,50)
					do conf autoMoveOnDeath_map geffen
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc geffen_in 77 173   
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
		case (== aldebaran) {
			if (&config (saveMap) != aldebaran) {
				do ai manual
				do move aldebaran &rand(137,141) &rand(113,117)
				do talknpc 143 119 c r0 n
				[
					do conf saveMap aldebaran
					do conf storageAuto $storageOption
					do conf storageAuto_npc aldebaran 143 119
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(110,130)
					do conf autoMoveOnDeath_y &rand(90,110)
					do conf autoMoveOnDeath_map aldebaran
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc aldeba_in 94 56   
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
		case (== payon) {
			if (&config (saveMap) != payon) {
				do ai manual
				do move payon &rand(175,179) &rand(98,102)
				do talknpc 181 104 c r0 n
				[	
					do conf saveMap payon
					do conf storageAuto $storageOption
					do conf storageAuto_npc payon 181 104
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(150,170)
					do conf autoMoveOnDeath_y &rand(70,90)
					do conf autoMoveOnDeath_map payon
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc payon_in01 5 49  
				]
				do ai auto
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}			
		}
		case (== morocc) {
			if (&config (saveMap) != morocc) {
				do ai manual
				do move morocc &rand(150,154) &rand(91,95)
				do talknpc 156 97 c r0 n
				[	
					do conf saveMap morocc
					do conf storageAuto $storageOption
					do conf storageAuto_npc morocc 156 97
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(120,140)
					do conf autoMoveOnDeath_y &rand(60,80)
					do conf autoMoveOnDeath_map morocc
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc morocc_in 141 67   
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
		case (== alberta) {
			if (&config (saveMap) != alberta) {
				do ai manual
				do move alberta &rand(107,111) &rand(54,58)
				do talknpc 113 60 c r0 n
				[	
					do conf saveMap alberta
					do conf storageAuto $storageOption
					do conf storageAuto_npc alberta 113 60
					do conf storageAuto_npc_steps c r1 n
					do conf autoMoveOnDeath 1
					do conf autoMoveOnDeath_x &rand(80,100)
					do conf autoMoveOnDeath_y &rand(30,50)
					do conf autoMoveOnDeath_map alberta
				]
				[
					do conf sellAuto $sellOption
					do conf sellAuto_npc alberta_in 188 21   
				]
				do ai on
				log $successLog
				release ChangeSavePoints
			} else {
				log $errorLog
				stop
			}
		}
	}
}
Last edited by MiDaM on 26 Sep 2018, 14:12, edited 1 time in total.
Image

fadreus
The Kore Devil
The Kore Devil
Posts: 724
Joined: 17 Nov 2017, 23:32
Noob?: No
Location: Genting Highland, Malaysia
Contact:

Re: help to fix this macro

#2 Post by fadreus »

Psst, use code instead of quote.

Try replace release <macroname> with all or $.caller.
Btw, u use latest version of eventMacro?

iRO Supporter.
Read before you ask is the wisest thing human can do.
Unless you're a cat.
Image

MiDaM
Human
Human
Posts: 35
Joined: 20 Jan 2010, 09:07
Noob?: Yes

Re: help to fix this macro

#3 Post by MiDaM »

solved thx

with release <macroname> with all
Image

Post Reply