Page 1 of 1

[Userfunction] coconutshy() - Flowerfestival

Posted: Sun Feb 17, 2013 1:52 am
by Rickster
When I was writing this to the userfunction forum, I saw that there already is a function for this event by kkulesza. Maybe you also want to give his function a try.

Index I release this as beta, because no one else has tested this jet. For me it easily scores up to 50+.
Feel free to report your feedback.

Description
This function does the coconutshy from the flower event on varanas bridge.
!!! Take care, that the userfunction actually does not do the questhandling for you. The event starts at the npc Waysie Fleckstein.
I will not provide a WP file for questhandling, as I do not need it myself.

Start this function manually or from a wp file and then start the event manually.
As soon as the mobs appear it automatically starts to throw at them.
Targeting is priority based, as some mobs give more points.
After the event has finished, the userfunctions stops automatically.

As a starting point there is a WP file attached, which calls the userfunction. Just run the wp file, then manually start the event.

Installation
Put the file "userfunction_coconutshy.lua" in the folder "MM\scripts\rom\userfunctions".
Then you can call the function from every wp file with

Code: Select all

coconutshy()
Additionally you can put the wp file "e_flower_coconut.xml" in the folder "MM\scripts\rom\waypoints".
Then you just have to run this wp file right before starting the event.

Configuration
There are a bunch of options on top of the userfunction. You can change them if you like. On my side it runs fine with the default settings.

Download
userfunction_coconutshy.lua
Version 0.03 beta
(6.56 KiB) Downloaded 225 times
e_flower_coconut.xml
WP file for starting
(137 Bytes) Downloaded 236 times

Re: [Userfunction] coconutshy() - Flowerfestival

Posted: Sun Feb 17, 2013 2:43 am
by lisa
Rickster wrote:After the event has finished, you manually have to break the script.
you can do this when standing at the bench
since there are 3 machines you need to use the specific ID for that machine,
closest to NPC is 120391
middle is 120392
furthest is 120393

I'll just use ID for middle one in this example

Code: Select all

		repeat	
		player:target(player:findNearestNameOrId(120392)) -- ID here for which bench you use
		Attack()
			yrest(200)
		until RoMScript("ExtraActionBarFrame:IsVisible()")
then you can do a while loop and checking for the same thing to dissappear before continuing'

Code: Select all

		while RoMScript("ExtraActionBarFrame:IsVisible()") do
-- code to throw roses
		end
you can then get it to move to the NPC and get the reward

Code: Select all

	player:moveTo(CWaypoint(3080,161))
	
	player:target_NPC(120380);
	yrest(500);
	sendMacro("ChoiceOption(2);");
Hope this helps.

Re: [Userfunction] coconutshy() - Flowerfestival

Posted: Sun Feb 17, 2013 8:57 am
by Rickster
Thanx Lisa!

New version in OP.
I changed the userfunction, so it automatically stops, when the event finishes.

There are a bunch of options on top of the userfunction. You can change them if you like. On my side it runs fine with the default settings.

I will not provide a WP file for questhandling, as I do not need it myself.

Ric

Re: [Userfunction] coconutshy() - Flowerfestival

Posted: Thu Feb 21, 2013 7:36 pm
by delay84
Nice work! Thank you!

If don't want to restart the bot each time just use that code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
	while true do
		player:target_Object(120391)
		yrest(1000)
		coconutshy()
		player:target_NPC(120380)
		yrest(1000)
		sendMacro("ChoiceOption(2);");
		yrest(1000)
		player:target_NPC(120380)
		yrest(1000)
		sendMacro("ChoiceOption(2);");
		yrest(1000)
		sendMacro("ChoiceOption(1);");
	end
			
</onLoad>
</waypoints>
Attention: It uses one transport rune to reset the game each time