Tier Stone Production: 2 Scripts to Rule them All

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
User avatar
Eggman1414
Posts: 111
Joined: Sun Jun 17, 2012 2:27 pm

Tier Stone Production: 2 Scripts to Rule them All

#1 Post by Eggman1414 » Fri Jan 25, 2013 3:08 am

See the updated thread in the Waypoints thread

http://www.solarstrike.net/phpBB3/viewt ... =27&t=5472

As Rock5 has explained on the last page here. The buyfromitemshop userfunction is server dependent
-- WARNING! GUIDs are unique per server. GUIDs given by other users might be wrong for your
-- server. So it's important to get your own GUIDs using the instructions below.
please check here for what you need to do, if you encounter a problem:

http://www.solarstrike.net/phpBB3/viewt ... =27&t=3039
Last edited by Eggman1414 on Sun Dec 29, 2013 9:27 am, edited 13 times in total.

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

Re: Elf Daily And Tier Stones

#2 Post by lisa » Fri Jan 25, 2013 3:34 am

Eggman1414 wrote:*As a note*This code does not do the charges for some reason. There is no error in rombot. just skips it. It seems to just skip right over it and log into the next character.
you created a function to do the charges but the function itself is never called.

You can either have the code not as a function, so delete the
function charges()
and also the
end
for that, or you can simply just call the function before the relog() like this
charges()
relog()



--=== ===--
you have
amountToBuy = phirCoins / 100
what if you don't have exactly 100 coins, so you have 150, amountToBuy will be 1.5, so when you -1 it will never be 0 and you will never leave the loop, maybe check if it is less than 1,
until 1 > amountToBuy
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Elf Daily And Tier Stones

#3 Post by rock5 » Fri Jan 25, 2013 3:53 am

Looks good. The reason it doesn't buy charges is because

Code: Select all

function charges()
    ...
end
creates the function, it doesn't run it. So either you just run the code instead, or move the function to the onload and then run it at the waypoint with

Code: Select all

charges()
To keep it simple I would create another waypoint file that checks your charges, goes to the mailbox to get it's mail, fuses, sends and then returns to the daily npc before loading the next character. That way if you don't want to run the fusing every day, you can just run the dailies. Then when you want to fuse, you run your buyer/sender script that sends the belts and fusion stones, then run the fusing script. There probably will be an issue trying to figure out the right number of items to send to the fusers.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: Elf Daily And Tier Stones

#4 Post by lisa » Fri Jan 25, 2013 4:01 am

Changed a couple of things, untested.
password function at top to help deal with different passes for different accounts, trying not to make the passwords a global of course

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
		--=== can add code here to deal with different accounts with different passes ===--
		--=== trying not to have a global variable with your password ===--
		
		function buycharges()
			BuyFromItemShop(896, "seconday password")
		end

		questEndNpcID1 = 112794
		questName1 = "Helping Them Grow" 
		function relog()
			SetCharList({
				{account=2 , chars= {2,3,4,5,6,7,8}},
				{account=54 , chars= {1,2,3,4,5,7,8}},
				{account=55 , chars= {1,2,3,4,5,6,7,8}},
				})
			LoginNextChar()
			yrest(3000)
			player:update()
			loadProfile()
			loadPaths("Daily.xml");
		end
</onLoad>
<!-- # 1 --><waypoint x="31847" z="4592" tag ="Main">
		local queststate = getQuestStatus(questName1);
		if queststate == "complete" then
			player:target_NPC(questEndNpcID1);
			CompleteQuestByName(questName1);
			yrest(300);
		end
      
		local dqCount, dqPerDay = RoMScript("Daily_count()");
		if dqPerDay == dqCount then      
			phirCoins = inventory:itemTotalCount(203038)
			print("We have "..phirCoins.." phirius coins")
			amountToBuy = phirCoins / 100
			print("trying to buy "..amountToBuy.." 10x arcane transmutor charges packs")
			repeat 
				buycharges()
				yrest(1000);
				amountToBuy = amountToBuy - 1
				inventory:useItem(202928);
				yrest(10);
				print("Using 10x arcane transmutor pack")
			until 1 > amountToBuy
			relog()
		else
			player:target_NPC(questEndNpcID1);
			AcceptQuestByName(questName1,questEndNpcID1);
			yrest(300);
		end
   </waypoint>
   <!-- #  3 --><waypoint x="31860" z="4646" y="9">   </waypoint>
   <!-- #  2 --><waypoint x="31742" z="5070" y="-11">   </waypoint>
   <!-- #  1 --><waypoint x="31416" z="5715" y="-33" tag = "Item1">   
		queststate = getQuestStatus(questName1)
		if queststate == "incomplete" then
			player:target_Object(112976,300);
			yrest(2500);
			__WPL:setWaypointIndex(__WPL:findWaypointTag("Item1"));
		end
    </waypoint>
   <!-- #  1 --><waypoint x="31416" z="5715" y="-33">   </waypoint>
   <!-- #  2 --><waypoint x="31742" z="5070" y="-11">   </waypoint>
   <!-- #  3 --><waypoint x="31860" z="4646" y="9">   </waypoint>
   <!-- #  4 --><waypoint x="31847" z="4583" y="9">   </waypoint>
</waypoints>
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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Elf Daily And Tier Stones

#5 Post by Jandrana » Fri Jan 25, 2013 4:18 am

And as a separate script: I would like to be able to run 1 script that will buy 10x excellent belts and send them to each character.
I will a attach two files, that you can use as an example for your request.

#1 - will buy belts in Limo desert and send them to a second char - requires rocks userfunction for UMM and lisas userfunction for party monitor
#2 - a user function with various helper functions also required by the buybelts script
(initially designed helping to cleanup bags after running mini games, but now I put more and more general useful functions there)
Attachments
userfunction_GeneralHelper.lua
(8.54 KiB) Downloaded 193 times
buybelts.xml
(1.88 KiB) Downloaded 175 times

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Elf Daily And Tier Stones

#6 Post by rock5 » Fri Jan 25, 2013 4:41 am

I've never used checkeventparty but wouldn't you want to send the belt to the one who messaged you?

Code: Select all

		repeat
			yrest(1000)
			msg, recipient = checkeventparty("belts", "ready");
		until msg
So sendBelts sends to the right person.

Cleanup functions are useful but I don't think they are relevant to this topic. An elf daily fuser would just have coins, t4 items, fusion stones and mana stones in it's inventory. It shouldn't be accumulating any other items.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Elf Daily And Tier Stones

#7 Post by Jandrana » Fri Jan 25, 2013 5:13 am

rock5 wrote:I've never used checkeventparty but wouldn't you want to send the belt to the one who messaged you?

Code: Select all

		repeat
			yrest(1000)
			msg, recipient = checkeventparty("belts", "ready");
		until msg
So sendBelts sends to the right person.
Yes, of course I'd like to send the belt to the char that messaged me.
I copied the usage from some other script, if I remember correctly.
As far as I understood the "checkeventparty(_name, _msg)" function, the first parameter is a kind of "tag" to identify
different event monitors. The second is the key word that you are waiting for.

It worked for me, maybe by accident ;-)

I just mentioned the cleanup stuff, I somebody was looking at the general helper user function file.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Elf Daily And Tier Stones

#8 Post by rock5 » Fri Jan 25, 2013 5:30 am

I just had a look at those functions. I looks like you are supposed to start monitoring party messages by typing

Code: Select all

eventParty("start")
You were lucky that it still started the way you wrote it because the logic in the function basically says, "if "stop" then stop the monitoring else start the monitoring". So anything besides "stop" starts the monitoring.

checkeventparty doesn't accept any arguments. It returns the message and name of a message or it returns nil. So if you want to use the name you have to use

Code: Select all

msg,name = checkeventparty()
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: Elf Daily And Tier Stones

#9 Post by lisa » Fri Jan 25, 2013 5:36 am

I don't know about checkeventparty, maybe it was a userfunction someone(maybe even me) wrote.

I can tell you about
checkEventParty()
and
eventParty()
as it is part of party.lua

call

Code: Select all

eventParty()
to start the monitoring

then use

Code: Select all

msg,name = checkEventParty()
to check for messages.

if you want to stop the monitoring just call

Code: Select all

eventParty("stop")
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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Elf Daily And Tier Stones

#10 Post by Jandrana » Fri Jan 25, 2013 6:11 am

I copied the code from "userfunction_partymonitoring.lua" that I've got from here: http://www.solarstrike.net/phpBB3/viewt ... monitoring

checkeventparty takes two arguments.

Code: Select all

function checkeventparty(_name, _msg)
	repeat
		local time, moreToCome, name, msg = EventMonitorCheck(_name, "4,1")
		if type(_msg) == "string" then
			if msg and name ~= player.Name then
				if string.find(string.lower(msg),string.lower(_msg)) then
					return true
				end
			end
		elseif type(_msg) == "table" then
			for k,v in pairs(_msg) do
				if msg and name ~= player.Name then
					if string.find(string.lower(msg),string.lower(v)) then
						return v
					end
				end		
			end
		else
			print("Incorrect message usage")
		end
	until msg == nil
end

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

Re: Elf Daily And Tier Stones

#11 Post by lisa » Fri Jan 25, 2013 6:30 am

Yeah I suspected it was one of my old ones lol

I am older and greyer since then, I suguest using the functions that are part of the default bot now, the ones I described last post.
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

Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: Elf Daily And Tier Stones

#12 Post by Jandrana » Fri Jan 25, 2013 7:13 am

Thanks for your update.
Yeah I suspected it was one of my old ones lol
I just followed the rule #1 in your forum signature ;-). The problem I mentioned some time ago, the forum is a big mess... *but I didn't say anything*

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

Re: Elf Daily And Tier Stones

#13 Post by lisa » Fri Jan 25, 2013 7:27 am

made me lol =)

Yeah the wiki is umm lacking, yeah lacking is a good word.

Basically what we need is a "teacher" as opposed to a "doer", I am a doer and like to make things work but sitting down explaining everything isn't my cup of tea.

Rock mentioned he would look at redoing the Wiki if a programme for wikis comes out for easy editing, "what you see is what you get".

I did some updating to theromwiki a while back and hated the format for editing =(
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Elf Daily And Tier Stones

#14 Post by rock5 » Fri Jan 25, 2013 7:38 am

I'm actually looking forward to it. There is an official wysiwyg editor being developed called VisualEditor. I'm sure Administrator will install it once he is confident it is ready for our needs. I don't think he ever considered 3rd party editors because he could not be sure of continued support and development, even if he could find one that worked with our content, which I believe he didn't. I believe initial versions have already been released. I think it is scheduled to be stable and "finished" by about mid year. But maybe it will be good enough to install before then. We can only hope. :)
http://www.mediawiki.org/wiki/VisualEditor
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

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

Re: Elf Daily And Tier Stones

#15 Post by lisa » Fri Jan 25, 2013 8:05 am

just so you know I edited the "userfunction" post telling people to use the existing functions that are part of default bot.

My example is probably bad but atleast it is there lol

Also moving this topic to "runes of magoc section, out of the userfunction section.
Once someone has a fully working script or 2 they can just create a topic in the userfunction/wp section for the finished product.
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

User avatar
Eggman1414
Posts: 111
Joined: Sun Jun 17, 2012 2:27 pm

Re: Elf Daily And Tier Stones

#16 Post by Eggman1414 » Fri Jan 25, 2013 2:55 pm

Ok so i have done some tinkering with the script and came up with this:
The Script buys 10 Excellent Belts and runs over to the mailbox but errors out at who it is sending the belts to.

Cant seem to add a picture of the error??
Anyways it says: Fri Jan 25 14:42:16 2013 : ...ts/rom/userfunctions/addon_Rock5s_Mail_Functions.lua:399: You must specify a recipient to use UMM_SendAdvanced()

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
-- Buy Belts script - V1.0 - written by Jandrana
-- Edited by Eggman1414

recipient = SetCharList({
            {account=2 , chars= {2,3,4,5,6,7,8}},
            {account=54 , chars= {1,2,3,4,5,7,8}},
            {account=55 , chars= {1,2,3,4,5,6,7,8}},
            });  
			-- the char that should receiver the belts.
itemName = "Excellent Belt"; 

function buyBelts()
	player:openStore("Nebular Grey-Eye")
	store:buyItem(itemName, 10);
	yrest(1000)
end

function sendBelts()
	local armor=MGbuildItemTableOfType("Armor");
	armor=selectItemsByName(armor, itemName);
	UMM_SendAdvanced(recipient,getIdsFrom(armor), nil, nil, nil, nil, nil, nil, nil, nil, nil);
end
</onLoad>
	<!-- #  1 --><waypoint x="2467" z="48296" y="136">	
		buyBelts();
	</waypoint>
	<!-- #  2 --><waypoint x="2603" z="48202" y="136">	</waypoint>
	<!-- #  3 --><waypoint x="2812" z="48230" y="136">		
		sendBelts();
	</waypoint>
	<!-- #  5 --><waypoint x="2576" z="48212" y="136">	</waypoint>
	<!-- #  6 --><waypoint x="2471" z="48302" y="136">	
	</waypoint>
</waypoints>
Now my question is, does the UMM_SendAdvanced command accept a set char list for the recipient variable? Like below?

Code: Select all

recipient = SetCharList({
            {account=2 , chars= {2,3,4,5,6,7,8}},
            {account=54 , chars= {1,2,3,4,5,7,8}},
            {account=55 , chars= {1,2,3,4,5,6,7,8}},
            });  
*Edit* I was just thinking, is it becasue SetCharList is already in the onload section? And if so is there a command to call the next character's name, or do I have to make a name table of every alt and do it that way?

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

Re: Elf Daily And Tier Stones

#17 Post by lisa » Fri Jan 25, 2013 7:37 pm

This part won't work at all

Code: Select all

UMM_SendAdvanced(recipient,getIdsFrom(armor), nil, nil, nil, nil, nil, nil, nil, nil, nil);
It's probably better if rock makes a suguestion as he knows more about the userfunction than me but I will say that recipient needs to be the characters name you are sending the items to, so it needs to be the actual name.
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

User avatar
Eggman1414
Posts: 111
Joined: Sun Jun 17, 2012 2:27 pm

Re: Elf Daily And Tier Stones

#18 Post by Eggman1414 » Fri Jan 25, 2013 9:17 pm

I ask because I have seen a number of people use just a name table and insert every alt's name.

Like kenzu38 posted on Rock5's Mailmod Thread
http://www.solarstrike.net/phpBB3/viewt ... &start=380

Code: Select all

<onLoad>
nameTable =
{
"Char1","Char2",etc etc
}
 counter = 1
</onLoad>
   <!-- #  1 --><waypoint x="31761" z="3614" y="-17">     
         if nameTable[counter] == "lastchar" then
            print("Done mailing.")
            player:sleep()
      else
      UMM_SendMoney(nameTable[counter], 240000)
      yrest(500);
      sendMacro("CloseAllWindows()");
            counter = counter + 1;    
         end
   </waypoint>
</waypoints>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Elf Daily And Tier Stones

#19 Post by rock5 » Fri Jan 25, 2013 11:04 pm

The function SetCharList is specifically for use with LoginNextChar().

The name table idea would work but it would need a list of names. You can't use numbers.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Eggman1414
Posts: 111
Joined: Sun Jun 17, 2012 2:27 pm

Re: Elf Daily And Tier Stones

#20 Post by Eggman1414 » Fri Jan 25, 2013 11:45 pm

Ok think I got it working. It is running in the background as I write this. Here is the code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
-- Buy Belts script - V1.0 - written by Jandrana
-- Edited by Eggman1414

nameTable =
{
--characters name goes here ("Example")
}
 counter = 1

 itemName = "Excellent Belt"; 

function buyBelts()
	player:openStore("Nebular Grey-Eye")
	store:buyItem(itemName, 10);
	yrest(1000)
end

function sendBelts()
	local armor=MGbuildItemTableOfType("Armor");
	armor=selectItemsByName(armor, itemName);
	UMM_SendAdvanced(nameTable[counter],getIdsFrom(armor), nil, nil, nil, nil, nil, nil, 10, nil, nil);
	yrest(500);
	sendMacro("CloseAllWindows()");
		counter = counter  + 1;
end
</onLoad>
	<!-- #  1 --><waypoint x="2467" z="48296" y="136">	
		buyBelts();
	</waypoint>
	<!-- #  2 --><waypoint x="2603" z="48202" y="136">	</waypoint>
	<!-- #  3 --><waypoint x="2812" z="48230" y="136">
         if nameTable[counter] == "Last characters Name Goes Here" then
            print("Done mailing.")
            player:sleep()
		else
		sendBelts();
end
	</waypoint>
	<!-- #  4 --><waypoint x="2576" z="48212" y="136">	</waypoint>
	<!-- #  5 --><waypoint x="2471" z="48302" y="136">	
	</waypoint>
</waypoints>
So im going to do the same script except use Fusion Stones for the next one.

Post Reply

Who is online

Users browsing this forum: No registered users and 120 guests