Page 1 of 1

Malatina Event Repeat Ticket

Posted: Fri Dec 19, 2014 2:14 pm
by mangozjeb1
Like in subject im looking for waypoint what will use Malatina Event Repeat Ticket. I was trying to use this.

Code: Select all

<onload>
   if inventory:itemTotalCount("Malatina Event Repeat Ticket") > 0 then
      inventory:useItem("Malatina Event Repeat Ticket") yest(1000)
      loadPaths("survivalr5")
   else
      loadpaths("nextfile")
   end
</onload>
But i got a error

I need it to hmm... for automatic farm malatina with cot_tele.xml and survivalR5.xml

Re: Malatina Event Repeat Ticket

Posted: Fri Dec 19, 2014 10:48 pm
by BlubBlab
I remember faintly I did something similar in my modified versions.:

Code: Select all

if(inventory:itemTotalCount(205816) > 0)then
				local item = inventory:findItem(205816)		
				if(item)then
					item:use()
				end
				loadPaths("cot_tele")
			elseif( inventory:itemTotalCount(207471) > 0)then
				local item = inventory:findItem(207471)		
				if(item)then
					item:use()
				end
				loadPaths("cot_tele")
			else
				loadPaths(When_Finished)
			end

Code: Select all

if(inventory:itemTotalCount(205815) > 0)then
			local item = inventory:findItem(205815)		
			if(item)then
				item:use()
			end
			loadPaths("survivalR5")
		elseif( inventory:itemTotalCount(207470) > 0)then
			local item = inventory:findItem(207470)		
			if(item)then
				item:use()
			end
			loadPaths("survivalR5")
		elseif( inventory:itemTotalCount(205814) > 0)then
			local item = inventory:findItem(205814)		
			if(item)then
				item:use()
			end
			loadPaths("cot_tele")
		elseif( inventory:itemTotalCount(207469) > 0)then
			local item = inventory:findItem(207469)		
			if(item)then
				item:use()
			end
			loadPaths("cot_tele")
		else
			loadPaths(When_Finished)
		end
This should help you

Re: Malatina Event Repeat Ticket

Posted: Fri Dec 19, 2014 11:15 pm
by rock5
Well the OPs code is pretty straight forward. It should load one file or the other but I don't see it loading either.

I just noticed. The second loadpaths is spelt wrongs. Should be,

Code: Select all

loadPaths("nextfile")
See if that helps. I'm surprised it didn't cause a "loadpaths is nil" error as "loadpaths" is an invalid function name.

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 6:34 am
by mangozjeb1
rock5 wrote:Well the OPs code is pretty straight forward. It should load one file or the other but I don't see it loading either.

I just noticed. The second loadpaths is spelt wrongs. Should be,

Code: Select all

loadPaths("nextfile")
See if that helps. I'm surprised it didn't cause a "loadpaths is nil" error as "loadpaths" is an invalid function name.
changed it and still the same
hxr8uy.jpg
BlubBlab wrote:I remember faintly I did something similar in my modified versions.:

Code: Select all

if(inventory:itemTotalCount(205816) > 0)then
 local item = inventory:findItem(205816) 
 if(item)then
 item:use()
 end
 loadPaths("cot_tele")
 elseif( inventory:itemTotalCount(207471) > 0)then
 local item = inventory:findItem(207471) 
 if(item)then
 item:use()
 end
 loadPaths("cot_tele")
 else
 loadPaths(When_Finished)
 end

Code: Select all

if(inventory:itemTotalCount(205815) > 0)then
 local item = inventory:findItem(205815) 
 if(item)then
 item:use()
 end
 loadPaths("survivalR5")
 elseif( inventory:itemTotalCount(207470) > 0)then
 local item = inventory:findItem(207470) 
 if(item)then
 item:use()
 end
 loadPaths("survivalR5")
 elseif( inventory:itemTotalCount(205814) > 0)then
 local item = inventory:findItem(205814) 
 if(item)then
 item:use()
 end
 loadPaths("cot_tele")
 elseif( inventory:itemTotalCount(207469) > 0)then
 local item = inventory:findItem(207469) 
 if(item)then
 item:use()
 end
 loadPaths("cot_tele")
 else
 loadPaths(When_Finished)
 end
This should help you
error like this
9adyr1.jpg
mby i did something wrong

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 7:12 am
by rock5
mangozjeb1 wrote:
rock5 wrote:Well the OPs code is pretty straight forward. It should load one file or the other but I don't see it loading either.

I just noticed. The second loadpaths is spelt wrongs. Should be,

Code: Select all

loadPaths("nextfile")

See if that helps. I'm surprised it didn't cause a "loadpaths is nil" error as "loadpaths" is an invalid function name.
changed it and still the same
In that case maybe one of the files you are trying to load doesn't exist. loadPaths does nothing if the file doesn't exist. That explains why you would get that error about no waypoints; it gets to the end of the waypoint file without loading the next one so it errors because it has nothing left to do.

Is either waypoint file "survivalr5" or "nextfile" missing from your waypoints folder?

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 7:13 am
by BlubBlab
Yeah I think I had them in a lua file either export them or swap the >

e.g.

Code: Select all

if(0 <  inventory:itemTotalCount(207471) )then

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 8:00 am
by mangozjeb1
In that case maybe one of the files you are trying to load doesn't exist. loadPaths does nothing if the file doesn't exist. That explains why you would get that error about no waypoints; it gets to the end of the waypoint file without loading the next one so it errors because it has nothing left to do.

Is either waypoint file "survivalr5" or "nextfile" missing from your waypoints folder?
thats how looks my waypoint folder i dont have something like nextfile.xml but i have survivalR5.xml so it should work
xur5lm.jpg

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 10:10 am
by rock5
mangozjeb1 wrote:i dont have something like nextfile.xml but i have survivalR5.xml so it should work
If you have a ticket. If you do have a ticket and it still isn't using it and loading the file then try adding a print message to be sure. Example

Code: Select all

<onload>
   if inventory:itemTotalCount("Malatina Event Repeat Ticket") > 0 then
      print("Using Malatina Event Repeat Ticket.")
      inventory:useItem("Malatina Event Repeat Ticket") yest(1000)
      loadPaths("survivalr5")
   else
      print("Malatina Event Repeat Ticket not found.")
      loadpaths("nextfile")
   end
</onload>

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 1:52 pm
by mangozjeb1
rock5 wrote:
mangozjeb1 wrote:i dont have something like nextfile.xml but i have survivalR5.xml so it should work
If you have a ticket. If you do have a ticket and it still isn't using it and loading the file then try adding a print message to be sure. Example

Code: Select all

<onload>
   if inventory:itemTotalCount("Malatina Event Repeat Ticket") > 0 then
      print("Using Malatina Event Repeat Ticket.")
      inventory:useItem("Malatina Event Repeat Ticket") yest(1000)
      loadPaths("survivalr5")
   else
      print("Malatina Event Repeat Ticket not found.")
      loadpaths("nextfile")
   end
</onload>
No message or smth in game or micromacro
still the same error
qp748e.jpg

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 3:46 pm
by BlubBlab
I something is wrong maybe you forgot to save your changes first or so or you have the wrong file.

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 6:17 pm
by mangozjeb1
BlubBlab wrote:I something is wrong maybe you forgot to save our changes first or so or you have the wrong file.
I saved it i am sure of that . And wat do you mean by wrong file ?

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 6:54 pm
by lisa
I don't have any RoM files on this PC so I can't test it but it looks to me like the actual file that code is in is missing important things. I am going to assume the posted code is ALL that is in the file.

Have a look at other WP posted that don't actually have any waypoints in them as an example of how to do it. I am sure there is quite a few posted already.

Re: Malatina Event Repeat Ticket

Posted: Sat Dec 20, 2014 11:24 pm
by rock5
I just tested it. Lisa is right. If that's all you have in the file then you will get that message, because it doesn't load properly so it doesn't run the onload.

Specifically look at how other waypoint files start and end. Copy them and it should work.

Re: Malatina Event Repeat Ticket

Posted: Sun Dec 21, 2014 8:10 am
by mangozjeb1
so you mean its not working because there is no waypoint to go. So mby it will work when we add option to check the status of the minigames e.g if we have done both it will use ticket , if not script will stop or smth

Re: Malatina Event Repeat Ticket

Posted: Sun Dec 21, 2014 9:57 am
by rock5
No, it doesn't need waypoints. There are a lot of waypoint files with out waypoints, eg. AT, survivalnext, etc. See how they start and end. Or just see how any waypoint file starts and ends. Let us know if you still can't figure it out.

Re: Malatina Event Repeat Ticket

Posted: Sun Dec 21, 2014 10:55 am
by mangozjeb1
ok now it works almost perfect, WP is looking like that

Code: Select all

<waypoint>
<onload>
   if inventory:itemTotalCount("Malatina Event Repeat Ticket") > 0 then
      print("Using Malatina Event Repeat Ticket.")
      inventory:useItem("Malatina Event Repeat Ticket") yest(1000)
      loadPaths("cot_tele")
   else
      print("Malatina Event Repeat Ticket not found.")
      loadpaths("nextfile")
   end
</onload>
</waypoint>

but after ending the sirvival malatina and using ticket im getting error like this
cccccc.jpg

Re: Malatina Event Repeat Ticket

Posted: Sun Dec 21, 2014 11:52 am
by BlubBlab
I think your files are corrupt I only knew a function called yrest and not yest take a look at that if it was your doing I would suggest rename the function in your file to yrest.

Re: Malatina Event Repeat Ticket

Posted: Sun Dec 21, 2014 7:23 pm
by rock5
Correct BlubBlub.

But also, it's not quite right. There is a difference between "waypoint" and "waypoints". :)

Re: Malatina Event Repeat Ticket

Posted: Mon Dec 22, 2014 11:57 am
by mangozjeb1
rock5 wrote:Correct BlubBlub.

But also, it's not quite right. There is a difference between "waypoint" and "waypoints". :)
idk what is the difference but now it work good only when i have not ebough phirus coins the script is starting to looping i mean
start-crash-start-crash-start-crash and all the time like that but its only when i have no PC so it not a big problem.

Big thanks to you all for help me deal with it ;*

Re: Malatina Event Repeat Ticket

Posted: Thu Dec 25, 2014 7:11 am
by rock5
mangozjeb1 wrote:idk what is the difference
"waypoint" tags are used for each point in a waypoint files. As you know, some waypoint files don't have any points, so no "waypoint" tags.

"waypoints" tag is used to enclose all the points. When onload support was added, that also had to go within the "waypoints" tags. So basically "waypoints" tags are used to start and end every waypoint file.

So every waypoint file should start and end something like this

Code: Select all

<waypoints>

   ...

</waypoints>
Or if you optionally include encoding information on the first line then something like this.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>

   ...
 
</waypoints>