Butterfly daily with resets script

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
wishblades
Posts: 36
Joined: Fri Aug 31, 2012 4:31 pm

Re: Butterfly daily with resets script

#21 Post by wishblades » Sun Jun 19, 2016 11:47 am

Lisa, I am looking at your code and I don't see how it would work running it through my head, haven't changed my code to test it since my code seems to be working GREAT but here is where I am confused in your code:

You do an IF statement to see if dailies = 10, if so, they reset, if they don't, they take the quest again and continues....

Now here is where the problem comes in at, IF dailies = 10, it resets then what? it SHOULD stop working because of the ELSE statement, it would never make it past there to take the quest again because in the command, it's IF dailies = 10, reset dailies OR take quest again, IF you reset, it never gets to the take daily again.

Here is mine that works great, haven't had an issue:

Code: Select all

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

<waypoints><!-- MountSpeedhack -->
<onLoad>

RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00MountSpeedhack: "Horse" Press key.CTRL to ACTIVATE! or DEactivate.|r')")
repeat
while not keyPressedLocal(key.VK_CONTROL) do yrest(100); end;
MountSpeedHack();
RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00MountSpeedhack: ACTIVATED!|r')")
yrest(1500);

while not keyPressedLocal(key.VK_CONTROL) do yrest(100); end;
MountSpeedoff();
RoMScript("DEFAULT_CHAT_FRAME:AddMessage('|cffffff00MountSpeedhack: DEactivated.|r')")
yrest(1500);
until false

startjParty();
startGMDetect()
while (true) do
yrest(100); 
end;

function quest()
local queststate = getQuestStatus("Catch Butterflies")
if queststate == "complete" then
player:mount("Horse");
__WPL:setForcedWaypointType("TRAVEL")
end
end

--== User Option ==--

Deliver = 0 -- Change if you want to enable/disable deliver quests 0=disable, any number = deliver after that amount of eggs (must b bigger than 9)
LagTime = 0 -- Affects accepting/completing quests. Increase LagTime if time is wasted by repeated CompleteQuests or AcceptQuests.
RunningSpeed = 59 -- The speed the character runs when not teleporting. 50 is normal. Recommended 100.
UseTeleporter = false -- Use Jduratedj's teleport userfunction. Please make sure you have it installed to use this option.
Timeout = 300 -- Time hens and eggs stay in the ignore list before being given another chance. '0' disables it, remains permanently in ignore list.
debugging = true -- Set to true to display extra useful information regarding egg drop rates and ignore lists.

--=================--

-- Apply speed hack
local playerAddress = memoryReadIntPtr(getProc(), addresses.staticbase_char, addresses.charPtr_offset);
if playerAddress ~= 0 then
memoryWriteFloat(getProc(), playerAddress + 0x40, RunningSpeed);
end
</onLoad>
</waypoints>

<!-- # 1 --><waypoint x="6414" z="5468" y="159">
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies");
local dqCount, dqPerDay = RoMScript("Daily_count()");
if dqCount == 10 then
player:sleep();
else
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies")
end
</waypoint>
<!-- # 4 --><waypoint x="6339" z="4882" y="182">
player:mount("Horse");
__WPL:setForcedWaypointType("TRAVEL")
</waypoint>
<!-- # 5 --><waypoint x="6435" z="4451" y="182">	</waypoint>
<!-- # 6 --><waypoint x="6503" z="4201" y="182">	</waypoint>
<!-- # 7 --><waypoint x="6530" z="4085" y="204">	</waypoint>
<!-- # 8 --><waypoint x="6551" z="3997" y="204">	</waypoint>
<!-- # 10 --><waypoint x="6572" z="3904" y="204">	</waypoint>
<!-- # 11 --><waypoint x="6605" z="3765" y="172">	</waypoint>
<!-- # 12 --><waypoint x="6834" z="3592" y="173">	</waypoint>
<!-- # 13 --><waypoint x="7031" z="3445" y="190">	</waypoint>
<!-- # 1 --><waypoint x="7135" z="3174" y="190">	</waypoint>
<!-- # 3 --><waypoint x="7360" z="3209" y="182">	</waypoint>
<!-- # 4 --><waypoint x="7342" z="3323" y="181">	</waypoint>
<!-- # 5 --><waypoint x="7449" z="3364" y="181">	</waypoint>
<!-- # 6 --><waypoint x="7514" z="3167" y="182">	</waypoint>
<!-- # 7 --><waypoint x="7631" z="3176" y="181">	</waypoint>
<!-- # 8 --><waypoint x="7662" z="3082" y="182">	</waypoint>
<!-- # 9 --><waypoint x="7555" z="3034" y="181">	</waypoint>
<!-- # 10 --><waypoint x="7541" z="3054" y="181">
queststate = getQuestStatus("Catch Butterflies")
if queststate == "complete" then
__WPL:setDirection(WPT_BACKWARD);
else
__WPL:setForcedWaypointType("NORMAL")
__WPL:setWaypointIndex(__WPL:findWaypointTag("one")); 
end
</waypoint>
<!-- # 12 --><waypoint x="7610" z="2659" tag ='one'>	</waypoint>
<!-- # 13 --><waypoint x="7662" z="2315" y="182">	</waypoint>
<!-- # 14 --><waypoint x="7646" z="2063" y="182">player:mount();	</waypoint>
<!-- # 15 --><waypoint x="7416" z="2033" y="177">player:mount();	</waypoint>
<!-- # 16 --><waypoint x="7104" z="2209" y="176">player:mount();	</waypoint>
<!-- # 17 --><waypoint x="6914" z="2155" y="176">player:mount();	</waypoint>
<!-- # 18 --><waypoint x="6911" z="2450" y="182">player:mount();	</waypoint>
<!-- # 19 --><waypoint x="7425" z="2660" y="181">
queststate = getQuestStatus("Catch Butterflies")
if queststate == "incomplete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("two"));
else
__WPL:setForcedWaypointType("TRAVEL")
__WPL:setWaypointIndex(__WPL:findWaypointTag("three")); 
end 
</waypoint>
<!-- # 21 --><waypoint x="7400" z="2656" tag ='two'>	</waypoint>
<!-- # 22 --><waypoint x="6991" z="2577" y="181">	</waypoint>
<!-- # 23 --><waypoint x="6211" z="2389" y="181">	</waypoint>
<!-- # 24 --><waypoint x="6261" z="2211" y="182">player:mount();	</waypoint>
<!-- # 25 --><waypoint x="6356" z="1784" y="182">player:mount();	</waypoint>
<!-- # 26 --><waypoint x="6537" z="1786" y="181">player:mount();	</waypoint>
<!-- # 27 --><waypoint x="6689" z="1788" y="178">player:mount();	</waypoint>
<!-- # 28 --><waypoint x="6769" z="1995" y="177">player:mount();	</waypoint>
<!-- # 29 --><waypoint x="6927" z="2180" y="177">player:mount();	</waypoint>
<!-- # 30 --><waypoint x="7015" z="2507" y="181">	</waypoint>
<!-- # 31 --><waypoint x="7611" z="2707" y="182">
queststate = getQuestStatus("Catch Butterflies")
if queststate == "complete" then
__WPL:setWaypointIndex(__WPL:findWaypointTag("three"));
else
__WPL:setForcedWaypointType("TRAVEL")
__WPL:setWaypointIndex(__WPL:findWaypointTag("one")); 
end
</waypoint>
<!-- # 33 --><waypoint x="7610" z="2722" tag ='three'>	</waypoint>
<!-- # 34 --><waypoint x="7534" z="3036" y="181">player:mount();	</waypoint>
<!-- # 35 --><waypoint x="7638" z="3073" y="182">	</waypoint>
<!-- # 36 --><waypoint x="7629" z="3177" y="182">	</waypoint>
<!-- # 37 --><waypoint x="7523" z="3183" y="182">	</waypoint>
<!-- # 38 --><waypoint x="7471" z="3355" y="181">player:mount();	</waypoint>
<!-- # 39 --><waypoint x="7348" z="3326" y="182">	</waypoint>
<!-- # 40 --><waypoint x="7366" z="3204" y="182">	</waypoint>
<!-- # 41 --><waypoint x="7140" z="3172" y="189">player:mount();	</waypoint>
<!-- # 42 --><waypoint x="7031" z="3498" y="189">	</waypoint>
<!-- # 43 --><waypoint x="6621" z="3769" y="173">player:mount();	</waypoint>
<!-- # 44 --><waypoint x="6558" z="3958" y="203">player:mount();	</waypoint>
<!-- # 45 --><waypoint x="6474" z="4284" y="182">	</waypoint>
<!-- # 46 --><waypoint x="6320" z="4903" y="181">player:mount();	</waypoint>
<!-- # 47 --><waypoint x="6350" z="5072" y="182">	</waypoint>
<!-- # 48 --><waypoint x="6427" z="5398" y="177">
queststate = getQuestStatus("Catch Butterflies");
if queststate == "complete" then
player:target_NPC("Robbie Butcher");
CompleteQuestByName("Catch Butterflies")
end
local dqCount, dqPerDay = RoMScript("Daily_count()");
if dqCount == 10 then

inventory:update(); -- putting these 5 lines in may work
player:update();
if inventory:itemTotalCount(202434) > 0 then 
inventory:useItem(202434);
end
end
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies")

</waypoint>
</waypoints>
I END both IF statements then target to retake quest, not sure if that's right but the code works perfectly.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Butterfly daily with resets script

#22 Post by lisa » Sun Jun 19, 2016 5:57 pm

local dqCount, dqPerDay = RoMScript("Daily_count()");

if dqCount == 10 then

-- this part is done if you have done all 10 dailies

player:update();

-- if you have atleast 1 daily reset it will use it

if inventory:itemTotalCount(202434) > 0 then
inventory:useItem(202434);


-- if you have no resets then it goes to sleep because you have done all 10 dailies.

else
sendMacro("LeaveParty();")
player:sleep();
end


--the next part is if you haven't done all 10 dailies.

else
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies")
end


Hope that clears it up for you =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

wishblades
Posts: 36
Joined: Fri Aug 31, 2012 4:31 pm

Re: Butterfly daily with resets script

#23 Post by wishblades » Tue Jun 21, 2016 10:48 pm

I understand the logic of the code, It just doesn't work for me, not saying I am a better programmer then you, you are waaaaay better then I am, this is first time I even looked at this language, I taught myself VBasic years ago but haven't done anything with it for years but I can still look at code and follow the logic of it mostly(and adjust something to make it work better) and here is where I am having the issue(same as when I ran the code in the bot program and stopped right where I thought it would:


if dqCount == 10 then <------------------ First IF statement

-- this part is done if you have done all 10 dailies

player:update();

-- if you have atleast 1 daily reset it will use it

if inventory:itemTotalCount(202434) > 0 then <-------Second IF Statement
inventory:useItem(202434);


-- if you have no resets then it goes to sleep because you have done all 10 dailies.

else
sendMacro("LeaveParty();")
player:sleep();
end <-----First END statement to end the same color IF statement

--the next part is if you haven't done all 10 dailies.

else
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies")
end <----Second END statement to end same color IF statment


Here is where the problem is, the first IF statement asks if 10 dailies are done, if so, reset(Blue IF statement), END IF, then it END IF again without talking to the NPC because it's in an IF-THEN-ELSE statement, If Daily = 10, Reset Else talk to quest giver which it will never do if Daily = 10, not sure if I am explaining it correctly, could you run it sometime and tell me if your's works for you because I couldn't get it to work at all till I changed mine to what I posted, Thank you for checking.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Butterfly daily with resets script

#24 Post by lisa » Wed Jun 22, 2016 3:58 am

pretty sure I was just editing code that was posted, didn't look at how or why it should or shouldn't work.

Easy solution is get rid of the else and move the target npc and accept quest to after the second end

Code: Select all

local dqCount, dqPerDay = RoMScript("Daily_count()");
if dqCount == 10 then

player:update();
if inventory:itemTotalCount(202434) > 0 then 
inventory:useItem(202434);
else
sendMacro("LeaveParty();")
player:sleep();
end
end
player:target_NPC("Robbie Butcher");
AcceptQuestByName("Catch Butterflies")
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: Butterfly daily with resets script

#25 Post by kenzu38 » Wed Jun 22, 2016 1:23 pm

@wishblades the code you posted seems to have lots of unneeded code. The interaction code with the quest NPC is separated in 2 waypoints, 1 and 48. It would be good to tidy it up and put them all together in one waypoint.

So something like this should take care of all possible situations:

Code: Select all

<!-- # 1 --><waypoint x="6414" z="5468" y="159">

local dqCount, dqPerDay = RoMScript("Daily_count()");
if dqCount == 10 then
	if inventory:itemTotalCount(202434) > 0 then 
		inventory:useItem(202434);
		yrest(1000)
		__WPL:setWaypointIndex(__WPL.LastWaypoint)
	else
		sendMacro("LeaveParty();")
		player:sleep();
	end		
else
	if getQuestStatus("Catch Butterflies") == "not accepted" then
		player:target_NPC("Robbie Butcher");
		AcceptQuestByName("Catch Butterflies")
		player:mount("Horse");
		__WPL:setForcedWaypointType("TRAVEL")
	elseif getQuestStatus("Catch Butterflies") == "complete" then
		player:target_NPC("Robbie Butcher");
		CompleteQuestByName("Catch Butterflies")
		yrest(500)
		__WPL:setWaypointIndex(__WPL.LastWaypoint)
	end						
end
</waypoint>
You can then delete WP 48. It's not needed anymore.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 26 guests