Page 1 of 1

Help for complete script

Posted: Thu Sep 13, 2012 5:21 pm
by Ballerlocke
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
</onLoad>
<!-- # 1 --><waypoint x="2510" z="-1387" y="53" tag="start">
player:target_NPC("Gildenburgverwalter"); ------------------go to Guild Castle
yrest(2000);
sendMacro("ChoiceOption(2);");
waitForLoadingScreen(10);
yrest(2000);
</waypoint>
<!-- # 1 --><waypoint x="0" z="-448" y="5"> </waypoint>
<!-- # 2 --><waypoint x="0" z="-396" y="5"> </waypoint>
<!-- # 3 --><waypoint x="0" z="-361" y="5">
numtoken = inventory:getItemCount(203402); ------------------- if the char has not enough Tempest Height Warrior Necklace for Quest go to Bank
if 30 >= numtoken then
-- Wait for user to use some shells.
__WPL:setWaypointIndex(__WPL:findWaypointTag("goBank"))
end
</waypoint>
<!-- # 4 --><waypoint x="-2" z="-327" y="5" tag="continue"> </waypoint>
<!-- # 5 --><waypoint x="-26" z="-299" y="5"> </waypoint>
<!-- # 6 --><waypoint x="-59" z="-268" y="5"> </waypoint>
<!-- # 7 --><waypoint x="-78" z="-235" y="5">
do player:target_NPC("Gildenquestbrett III"); ------------------ Accept Quest Guild Need Weapons
sendMacro("OnClick_QuestListButton(1,5)");
sendMacro("CompleteQuest()");
sendMacro("CloseWindows()");
end
do player:target_NPC("Gildenquestbrett III"); -------------------- Complett Quest Guild Need Weapons
sendMacro("OnClick_QuestListButton(3,1)");
sendMacro("AcceptQuest()");
sendMacro("CloseWindows()");
yrest(1000);
end
RoMScript("ChangeChar()"); ------------------------- Login Next Char on this Account
waitForLoadingScreen()
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"))
</waypoint>


<!-- # 1 --><waypoint x="0" z="-223" y="5" tag="goBank"> </waypoint>
<!-- # 2 --><waypoint x="-1" z="-60" y="5"> </waypoint>
<!-- # 3 --><waypoint x="0" z="101" y="7"> </waypoint>
<!-- # 4 --><waypoint x="0" z="256" y="7"> </waypoint>
<!-- # 5 --><waypoint x="12" z="439" y="7"> </waypoint>
<!-- # 6 --><waypoint x="27" z="540" y="7"> </waypoint>
<!-- # 7 --><waypoint x="40" z="619" y="7">
player:target_NPC("112062"); ------------ Guild Treasury Switch open
yrest(2000)
local count = 30;
local item = guildbank:findItem("203402")
while ((99 > count) and (item)) do
item:moveTo("bags")
count = count + item.ItemCount;
item = guildbank:findItem("203402");
end
yrest(4000)
player:target_NPC("112062"); ------------ Guild Treasury Switch close
</waypoint>
----- -Here is my problem i don't no how i write to take out one stack of the Questitem of the Bank/ In the Bank are allways item for the quest on index tab one-

<!-- # 9 --><waypoint x="15" z="545" y="7"> </waypoint>
<!-- # 10 --><waypoint x="-10" z="450" y="7"> </waypoint>
<!-- # 11 --><waypoint x="-12" z="308" y="7"> </waypoint>
<!-- # 12 --><waypoint x="-9" z="142" y="7"> </waypoint>
<!-- # 13 --><waypoint x="-7" z="17" y="7"> </waypoint>
<!-- # 14 --><waypoint x="-6" z="-161" y="5"> </waypoint>
<!-- # 15 --><waypoint x="-6" z="-248" y="5">
__WPL:setWaypointIndex(__WPL:findWaypointTag("continue"))
</waypoint>
</waypoints>

Re: Help for complete script

Posted: Thu Sep 13, 2012 7:03 pm
by BillDoorNZ
please put code and waypoint xml in code tags!!! makes it easier to read

not sure who "Gildentresor-Schalter" is - assume bank npc?

What you need to do is:

1) talk to the bank npc and get them to open your bank bag (Use the ChoiceOptionByName helper method)
2) use rocks item stuff to find the item you want:

Code: Select all

local count = 0;
local item = bank:findItem("itemname")
while ((count < numberOfItemsINeed) and (item)) do
	item:moveTo("bags")
	count = count + item.ItemCount;
	
	item = bank:findItem("itemname"); 
end

Re: Help for complete script

Posted: Fri Sep 14, 2012 3:54 am
by Jandrana
not sure who "Gildentresor-Schalter" is - assume bank npc?
It's "Guild Treasury Switch"

Just a small hint: to make scripts working independent of client language it is better
to use object id's. You will find them in runes database. To keep scripts readable
add the name of the object, quest, npc as a comment (preferable in english).
So people that need to understand the script, don't need to lookup the id in runesdatabase.

Example for the "Guild Treasury Switch" -> http://www.runesdatabase.com/npc/112062/

Re: Help for complete script

Posted: Fri Sep 14, 2012 6:13 am
by Ballerlocke
thanks jandrana but this point is ok i play in german. i can yous the ID of the switcher then all countrys can yous this script

Re: Help for complete script

Posted: Fri Sep 14, 2012 7:20 am
by Ballerlocke
I have update the script for hope you can better read this

BillDoorNZ I tried your but in notepad++ he see a problem after
"while ((count <"


Code:
local count = 0;
local item = bank:findItem("203402")
while ((count < numberOfItemsINeed) and (item)) do
item:moveTo("bags")
count = count + item.ItemCount;

item = bank:findItem("203402");
end

Re: Help for complete script

Posted: Fri Sep 14, 2012 8:49 am
by rock5
Can't use '<' in xml files. They are interpreted as the beginning of a tag. Easy solution just switch them around. xml files have no problem with '>'. So

Code: Select all

while ((numberOfItemsINeed > count) and (item)) do
will work just fine and means the same thing.

Re: Help for complete script

Posted: Fri Sep 14, 2012 9:10 am
by BillDoorNZ
dont know that bank will work for you either...given its the guild bank, not a normal bank. Rock may know how that one works or have implemented stuff already.

Re: Help for complete script

Posted: Fri Sep 14, 2012 9:21 am
by rock5
The same. Just substitute guildbank for bank. Good to see someone use these extra classes I added.

Re: Help for complete script

Posted: Fri Sep 14, 2012 10:10 am
by Ballerlocke
i update again but he still don't pickup item out of bank where is the mistake

Re: Help for complete script

Posted: Fri Sep 14, 2012 10:37 am
by rock5
Ids are numbers, not strings. Try removing the quotes.

Re: Help for complete script

Posted: Sat Sep 15, 2012 5:24 pm
by Ballerlocke
thanks now it goes
next plan if he go to Guildbank send Guildrubins to a other Char

Re: Help for complete script

Posted: Wed Oct 10, 2012 4:49 pm
by valsan
Hi all!

Im writing a waypoint to do the guild quest, basically i copy from this post but it dont run.

The seccion of the error is when try to get item from the guild bank:

Code: Select all

player:target_NPC("112062"); 
yrest(6000)
player:target_NPC("112062"); --open twice, in case anyone left open
yrest(1000)

item = guildbank:findItem("Collar del guerrero de Cumbre Tempestad")
if item then
    item:moveTo(bags)
end
i try using the ID from database, use while and if....

sorry for my very bad english :)

Re: Help for complete script

Posted: Thu Oct 11, 2012 7:55 am
by valsan
I also try with

Code: Select all

local count = 0;
local item = bank:findItem(203402) 
while ((count < 30) and (item)) do
item:moveTo("bags")
count = count + item.ItemCount;

item = bank:findItem(203402);
end
but not working, even using guildbank:findItem not workin...

any help or tip please?

Re: Help for complete script

Posted: Thu Oct 11, 2012 9:55 am
by rock5
That code works for me. Maybe you are not giving the bank or guildbank enough time to open before using that code.

Re: Help for complete script

Posted: Thu Oct 11, 2012 11:02 pm
by valsan
Finnaly run!!

This is the code i used for it:

Code: Select all

local count = 0;
local item = guildbank:findItem(203402);

while ((30 > count) and (item)) do
item:moveTo("bags");
count = count + item.ItemCount
item = guildbank:findItem(203402);
yrest(2000)
end