Page 2 of 3

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Wed Feb 05, 2014 2:22 pm
by Lamkefyned
thank you very much

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sun Feb 09, 2014 11:07 am
by Lamkefyned
Hi, I just need one thing

How to create a menu to jump to tags

Code: Select all

if you get one that goes to tag BOS1

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sun Feb 09, 2014 11:34 am
by rock5
Just print the options, get the user input with io.stdin:read(), then go to the tag selected by the user. Eg.

Code: Select all

print("Here are the options:")
print("   1. One")
print("   2. Two")
print("   3. Three")
printf("Enter a number > ")
local selected = io.stdin:read()
if selected == 1 then 
    __WPL:setWaypointIndex(__WPL:findWaypointTag("One"))
elseif selected == 2 then 
    __WPL:setWaypointIndex(__WPL:findWaypointTag("Two"))
elseif selected == 3 then 
    __WPL:setWaypointIndex(__WPL:findWaypointTag("Three"))
end

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Wed Feb 12, 2014 5:13 pm
by Lamkefyned
this can be done?

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
    <!-- ***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***********************************                                                               AMBOLIA SCRPT GRAFFU´S FARM BETA V1
***********************************
***********************************                                                                         05/02/2014
***********************************
***********************************                                                                                 
***********************************
***********************************
***********************************
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************	-->

    <!--************************************************************************************************************ FUNCTION SETWINDOW ************************************************************************************************************ -->
         setwindow ("mem")

    <!-- *********************************************************************************************************** FUNCTION CHOICE NUMBER RUN ************************************************************************************************* -->
		 		Nbrun = 0
		repeat
			cprintf(cli.lightgreen,"\n\n\n          Welcome On Graffu's farm !\n\n") 
			print("Choose run's number: ")
			print("\nNbrun>")
			Nbrun = io.stdin:read()
			Nbrun = tonumber(Nbrun)
		until Nbrun and Nbrun > 0
		
		cprintf(cli.blue, "\n\n				Have nice farm on Graffu V1.0 !\n				Create by AMBOLIA !\n\n\n")
	
		if Nbrun > 157
			then cprintf(cli.red,"\n\n Sorry, Maximum is 157 ! Because 157*19=2983 ! You can't have more of 2983 Mementos \n\n")
			yrest(3000)
			loadPaths(__WPL.FileName);
		end
		
		SlashCommand("aid easy")
		
	<!-- *********************************************************************************************************** FUNCTION WARDEN_SUMMON_CHIRON_THE_CENTAUR *********************************************************************  -->
			function Summon()
			player:cast("WARDEN_SUMMON_CHIRON_THE_CENTAUR")
		end

	<!--  ********************************************************************************************************** FUNCTION TO DEFINE ORIGIN'S WAYPOINT  ************************************************************************************* -->
			__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))

	<!--  ********************************************************************************************************** FUNCTION UNBRIDLED ENTHUSIAM+LUCKY TARGET  ************************************************************************** -->
		function Buff()
			player:update()
			if not player:hasBuff("506684") 
				then inventory:useItem(207200);
			end
			
			if (not player:hasBuff("506687")) 
				then inventory:useItem(207203);
			end 
		end
		
	<!--  *********************************************************************************************************** FUNCTION COUNT SELL  ************************************************************************************************************** -->
		Mcount = 0
		function Mcountround()
			Mcount = Mcount+1;
		end
		
	<!--  *********************************************************************************************************** FUNCTION COUNT DEAD  ************************************************************************************************************** -->
		Dcount = 0
		function Dcountround()
			Dcount = Dcount+1;
		end	
		
	<!--  *********************************************************************************************************** FUNCTION COUNT BUG  **************************************************************************************************************** -->
		Bcount = 0
		function Bcountround()
			Dcount = Bcount+1;
		end	
		
	<!--  ********************************************************************************************************** FUNCTION COUNT ANCIENT MEMENTO  ********************************************************************************************** -->
		Acount = 0
		function Acountround()
			Acount = Count*19;
		end
		
	<!--  ********************************************************************************************************** FUNCTION COUNT RUN  ******************************************************************************************************************* -->
		Count = 0
		function Countround()
			Count = Count+1;
		end
		
	<!--  ********************************************************************************************************** FUNCTION NUMBER RUN & CHECK MEMENTO'S NUMBER  ************************************************************************* -->
		function number()
			End = 0
			if ( Nbrun == Count )
				then printf("\n\n All run done !\n\n");
				End = 1
				SlashCommand("ILG destroy")
				waitForLoadingScreen()
				__WPL:setWaypointIndex(__WPL:findWaypointTag("return"))
			end
			
			Mentos = getCurrency("mento")
			if ( Mentos == 2983 )
				then printf("\n\n Full Ancient Memento !\n\n");
				End = 1
				SlashCommand("ILG destroy")
				waitForLoadingScreen()
				__WPL:setWaypointIndex(__WPL:findWaypointTag("return"))			
			end
		end
		
	<!--  *********************************************************************************************************** FUNCTION NUMBER RUN & CHECK MEMENTO'S NUMBER  **************************************************************************** -->
		function lastrun()
			restmentos = 2983 - Mentos;
			lrun= restmentos / 19 ;		
		end
		
	<!--  *********************************************************************************************************** FUNCTION CHECK BAG  *********************************************************************************************************************** -->
		function bag()
			Rightbag = 0
			if ( Rightbag == 0 )
				then
					local bcount = inventory:getItemCount(0)
					if(  5 > bcount ) 
						then
							SlashCommand("ILG destroy")
							waitForLoadingScreen()
							SlashCommand("ILG inv")
							__WPL:setWaypointIndex(__WPL:findWaypointTag("return"))
					end
			end		
		end
				
	<!--  *********************************************************************************************************** FUNCTION GROUP  ******************************************************************************************************************************* -->
		function ireset()
			SlashCommand("ILG destroy")
			yrest(500)
			SlashCommand("ILG inv")
		end		
		
	<!--  ********************************************************************************************************** FUNCTION TELEPORT PNJ  ********************************************************************************************************************** -->
		function tp()
		    teleportToWP()
		end

	<!--  ********************************************************************************************************** FUNCTION INFORMATION  ************************************************************************************************************************* -->
		function Info()
			cprintf(cli.pink, "\n\nNbr Round done: %s for %s Mementos win !\n", Count, Acount)
			cprintf(cli.pink, "You have %s Mementos ! You chose %s run ! You can do again %s run ! \n",Mentos, Nbrun, lrun)
			cprintf(cli.yellow, "Nbr Sell: %s \n", Mcount)
			cprintf(cli.red, "Nbr Dead: %s and Nbr Bug: %s\n\n", Dcount, Bcount)
		end
</onLoad>
						<!--  *********************************************************************************************************** WAYPOINT ENTRAR EN GRUPO Y ENTRAR EN GRAFFU  ******************************************************** -->
	<!-- #  1 -->	<waypoint x="-8472" z="45468" y="758" tag="start" type="TRAVEL"> changeProfileOption("LOOT",false); ireset() </waypoint>
<Onload>
		 		Nbrun = 0
		repeat
			cprintf(cli.lightgreen,"\n\n\n          Welcome On Graffu's farm !\n\n") 
			print("Choose run's number: ")
			print("\nNbrun>")
			Nbrun = io.stdin:read()
			Nbrun = tonumber(Nbrun)
		until Nbrun and Nbrun > 0
		
		cprintf(cli.blue, "\n\n				Have nice farm on Graffu V1.0 !\n				Create by AMBOLIA !\n\n\n")
	
		if Nbrun > 157
			then cprintf(cli.red,"\n\n Sorry, Maximum is 157 ! Because 157*19=2983 ! You can't have more of 2983 Mementos \n\n")
			yrest(3000)
			loadPaths(__WPL.FileName);
		end
		
		SlashCommand("aid easy")
</Onload>

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 6:13 pm
by Lamkefyned
Because of me this error?

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onLoad>
    <!--**********************************************************************************************************************************************************************************************************************-->
    <!--***********************************                                  AMBOLIA SCRPT GRAFFU´S FARM                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                            Version Stable V1                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                                   15/02/2014                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                                                          Support: http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&t=5560  ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--**********************************************************************************************************************************************************************************************************************-->
print("Here are the options:")
print("   1. One Boss")
print("   2. Two Boss")
print("   3. Three Boss")
printf("Enter a number > ")
local selected = io.stdin:read()
if selected == 1 then 
    loadPaths("Boss1.xml");
elseif selected == 2 then 
    loadPaths("Boss2.xml");
elseif selected == 3 then 
    loadPaths("Boss3.xml");
end
</onLoad>
<waypoints>
Error.png

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 7:25 pm
by Bill D Cat
Line 5, Position 98 is the apostrophe character that you used in "AMBOLIA SCRPT GRAFFU´S FARM".
Try changing that to another character and see if it helps.
I'm not sure WHY this would cause an error, since it is part of a comment, but it seems to be the case.

Also, as discussed in another thread (http://solarstrike.net/phpBB3/viewtopic.php?f=21&t=5575):
io.stdin:read() will return your input as a string, so you need to quote your results when comparing them.

Code: Select all

local selected = io.stdin:read()
if selected == "1" then
    loadPaths("Boss1.xml");
elseif selected == "2" then
    loadPaths("Boss2.xml");
elseif selected == "3" then
    loadPaths("Boss3.xml");
end

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 8:33 pm
by Lamkefyned
That's fixed but now I have another lol

Code: Select all

<waypoints>
<onLoad>
    <!--**********************************************************************************************************************************************************************************************************************-->
    <!--***********************************                                  AMBOLIA SCRIPT GRAFFU FARM                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                            Version Stable V1                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                                   15/02/2014                                                                                   ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--***********************************                                                                          Support: http://www.solarstrike.net/phpBB3/viewtopic.php?f=27&t=5560  ***********************************-->
    <!--***********************************                                                                                                                                                ***********************************-->
    <!--**********************************************************************************************************************************************************************************************************************-->
print("Here are the options:")
print("   1. One Boss")
print("   2. Two Boss")
print("   3. Three Boss")
printf("Enter a number > ")
local selected = io.stdin:read()
if selected == "1" then
    loadPaths("Boss1.xml");
elseif selected == "2" then
    loadPaths("Boss2.xml");
elseif selected == "3" then
    loadPaths("Boss3.xml");
end
</onLoad>
<waypoints>
error 2.png

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 8:40 pm
by Bill D Cat
Look at your last tag: It is <waypoints> instead of </waypoints>

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 9:28 pm
by Lamkefyned
Thanks, as I can put it like this?

Code: Select all

    loadPaths("..getFilePath(__WPL.FileName)../Start.xml");

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 9:44 pm
by Bill D Cat
That looks like it will load the file "start.xml" that is in the same directory as the currently loaded waypoint file.

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 9:59 pm
by Lamkefyned
But it gives me error
Sin título.png

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 10:05 pm
by Bill D Cat
You were quoting the whole string so it used it literally. Try it like this.

Code: Select all

    loadPaths(getFilePath(__WPL.FileName).."/Start.xml");

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Fri Feb 14, 2014 10:35 pm
by Lamkefyned
I will take note of all his contribution to this project

Thanks, now I'm off to bed a 14 year old boy can not go to bed at 5.

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sat Feb 15, 2014 1:25 pm
by Lamkefyned
I have an error.

when going to attack this error check
Sin título.png
SCRIPT 1
Start_Boss1.xml
(4.02 KiB) Downloaded 127 times
Start_Boss1_Onload.lua
(2.34 KiB) Downloaded 108 times

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sat Feb 15, 2014 6:33 pm
by lisa
What version of rombot are you using, the nearest sprintf I can find is at line 1297.

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sat Feb 15, 2014 7:25 pm
by Lamkefyned
revision 771
BOT_VERSION = 3.29;

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sat Feb 15, 2014 10:32 pm
by rock5
There is a cprintf on that line. I believe sprintf refers to the sprintf that is used in the cprintf function. So the nil value is actually the second value used in cprintf. Hm.. or maybe not "language[173]" should exist. Maybe it's the third value.

Anyway, the problem is this line

Code: Select all

changeProfileOption(LOOT,False)
The first value should be a string and the boolean value should not be capitalized.

Code: Select all

changeProfileOption("LOOT",false)

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sun Feb 16, 2014 8:12 am
by Lamkefyned
I have an error.
Sin título.png
Start_Boss2.xml
(5.37 KiB) Downloaded 120 times
Start_Boss2_Onload.lua
(2.34 KiB) Downloaded 114 times

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sun Feb 16, 2014 8:34 am
by rock5
Somewhere you used

Code: Select all

loadPaths("__WPL.FileName")
__WPL.FileName is a variable that holds the file name of the current waypoint list. When you put quotes around it, it is seen as a string, not a variable. So it tries to load a file literally name "__WPL.FileName" which of course doesn't exist. If you want to use the value held by the variable and reload the current waypoint list then use,

Code: Select all

loadPaths(__WPL.FileName)

Re: AMBOLIA´s Graffu Farm first,two,three boss

Posted: Sun Feb 16, 2014 5:33 pm
by Lamkefyned
Thanks, I just missing 3 scripts