Having trouble with a script. [Resolved]

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

Moderator: Moderators

malkirion
Noob
Noob
Posts: 1
Joined: 01 Jul 2013, 10:09
Noob?: Yes

Having trouble with a script. [Resolved]

#1 Post by malkirion »

I was looking into the guide for macros on the site and I'm a noob with coding. I found a script for a char to convert Rough Oridecon and Rough Elunim and I was trying to convert it into an automacro as follows:

Code: Select all

automacro roughOris {
	(@invamount (Rough Oridecon) <= 5)
	call {
	macro ref {
       		do move prt_in 59 60
       		call ref-while
	}
	macro ref-while {
       	log start refining with
       	$ori = @invamount (Rough Oridecon) R. Oris
       	$elu =  @invamount (Rough Elunium) R. Elus
       	log $ori $elu
       	while (@invamount (Rough Oridecon) > 4) as loop
               		do talk 0
               		pause 0.8
               		do talk resp 0
               		call ref-while
       	end loop
       	while (inventory (Rough Elunium) > 4) as loop
               		do talk 0
               		pause 0.8
               		do talk resp 1
               		call ref-while
       		end loop
       		stop
		}
	timeout 1
	}
}
The problem I'm getting is that when I run the start program it returns "automacro roughoris: macro ref-while not found." I have the macro in the brackets and ref-while is right below it. Sorry I'm really new and I'm unsure of what I did wrong, can anyone fill me in?

Sincerely,
Malkirion

Edit: Fixed Updated Code Was:

Code: Select all

automacro roughOris {
     inventory "Rough Oridecon" >= 5
     call ref 
timeout 300
}
macro ref {
       do move prt_in 59 60
       call ref-while
}
macro ref-while {
       log start refining with
       $ori = @invamount (Rough Oridecon) R. Oris
       $elu =  @invamount (Rough Elunium) R. Elus
       log $ori $elu
       while (@invamount (Rough Oridecon) > 4) as loop
               do talk 0
               pause 0.8
               do talk resp 0
               call ref-while
       end loop
       while (inventory (Rough Elunium) > 4) as loop
               do talk 0
               pause 0.8
               do talk resp 1
               call ref-while
       end loop
       stop
}
If anyone else needs it, you just need to edit the timeout to what it takes the normal ref macro to operate. I was working with stacks of 180 through autogather.