Page 1 of 1
Compiling Error
Posted: Sat Oct 23, 2010 3:23 am
by Personalausweis
Code: Select all
<!-- # 10 --><waypoint x="5528" z="-4382"> </waypoint>
<!-- # 11 --><waypoint x="5534" z="-4432">
player:target_NPC("Lehman");
if RoMScript("IsMagicBoxEnable()");
then
sendMacro("ChoiceOption(1);");yrest(2000);
sendMacro("ChoiceOption(1);");yrest(2000);
RoMScript StoreBuyItem(3, inventory:itemTotalCount(203038)/30);
else
sendMacro("AcceptQuest()"); yrest(1000);
sendMacro("CompleteQuest()"); yrest(1000);
end
</waypoint>
<!-- # 12 --><waypoint x="5525" z="-4379"> </waypoint>
what it SHOULD do is:
target Lehman and if AT is enabled he should buy charges for all phirius divided by 30 (900 phirius / 30 = 10 charges)
otherwise he shall activate the AT.
but MM encountered an error by compiling and i shall check waypoint #12
he did not buy anything an did not activate the AT so he didn't even worked on #11
€dit:
Code: Select all
<!-- # 10 --><waypoint x="5528" z="-4382"> </waypoint>
<!-- # 11 --><waypoint x="5534" z="-4432">
player:target_NPC("Lehman");
local questCompleted = RoMScript("CheckQuest(421457);");
if questCompleted == 2
then
keyboardPress(key.VK_SPACE);
else
keyboardPress(key.VK_SPACE);
keyboardPress(key.VK_SPACE);
end
</waypoint>
<!-- # 12 --><waypoint x="5525" z="-4379"> </waypoint>
changed AT request.
and he jumped twice.
as i put back the a.m. code
Code: Select all
sendMacro("ChoiceOption(1);");yrest(2000);
sendMacro("ChoiceOption(1);");yrest(2000);
RoMScript StoreBuyItem(3, inventory:itemTotalCount(203038)/30);
he gave an error again.
Re: Compiling Error
Posted: Sat Oct 23, 2010 3:46 am
by swietlowka
this if RoMScript("IsMagicBoxEnable()"); for sure doesnt work as this function is not valid
i use:
local ATQ= RoMScript("CheckQuest(421457);");
if ATQ == 0
then
blah balh blah
end;
Re: Compiling Error
Posted: Sat Oct 23, 2010 3:50 am
by Personalausweis
Hi, i made some changes:
Code: Select all
player:target_NPC("Lehman");
local questCompleted = RoMScript("CheckQuest(421457);");
if questCompleted == 0
then
player:target_NPC("Lehman");
sendMacro("AcceptQuest()"); yrest(1000);
sendMacro("CompleteQuest()"); yrest(1000);
else
player:target_NPC("Lehman");
sendMacro("ChoiceOption(1);");
yrest(2000);
sendMacro("ChoiceOption(1);");yrest(2000);
RoMScript StoreBuyItem(3, inventory:itemTotalCount(203038)/30);
end
but it still doesn't work -.-
any ideas?
Re: Compiling Error
Posted: Sat Oct 23, 2010 8:41 am
by Administrator
Code: Select all
RoMScript StoreBuyItem(3, inventory:itemTotalCount(203038)/30);
Usually it's a good idea to open the RoMScript function with it's necessary parenthesis and quotes.
Re: Compiling Error
Posted: Sat Oct 23, 2010 9:10 am
by Personalausweis
Code: Select all
RoMScript("StoreBuyItem(1, inventory:itemTotalCount(203038)/30)");
looks better this way? ^^
or shall i reset "inventory:itemTotalCount(203038)/30" with
local Charges = inventory:itemTotalCount(203038)/30
i'll give it a try
€dit:
Code: Select all
player:target_NPC("Lehman");
sendMacro("AcceptQuest();");
yrest(1000);
sendMacro("CompleteQuest();");
yrest(1000);
he targets Lehman, opens dialog, but didn't accept q
MM says:
"Drücke MACRO: RoMScript ausführen "AcceptQuest();" "
"Drücke MACRO: RoMScript ausführen "CompleteQuest();" "
i'm really stucked with it

Re: Compiling Error
Posted: Sat Oct 23, 2010 9:35 am
by Administrator
Code: Select all
RoMScript("StoreBuyItem(1, " .. inventory:itemTotalCount(203038)/30) .. ")");
inventory:itemTotalCount() is a MicroMacro function so you will not pass it to RoM.
Re: Compiling Error
Posted: Sat Oct 23, 2010 9:47 am
by Personalausweis
ok but can i use it this way?
Code: Select all
local charges = inventory:itemTotalCount(203038)/30
RoMScript("StoreBuyItem(1, charges)");
do you have an idea to solve the problem that he did not accept the quest from Lehman?
€dit:
he takes the quest i added:
Code: Select all
player:target_NPC("Lehman");
sendMacro("OnClick_QuestListButton(1,1)");
yrest(1000);
Re: Compiling Error
Posted: Sat Oct 23, 2010 10:20 am
by Herbee
hey,
Code: Select all
RoMScript("StoreBuyItem(1, charges)");
is crap. You can only call this function with a count of items to buy, if the item u want to buy is stackable, such as potions.
However, if those items were stackable, code would be:
Code: Select all
RoMScript("StoreBuyItem(1," .. charges .. ");");
If u want to buy 3 items, that aren't stackable, just use the macro several times, i.e. in a loop:
Code: Select all
player:merchant("Lehman"); yrest(2000);
sendMacro("ChoiceOption(1);"); yrest(1000);
while (inventory:itemTotalCount(203038) > 0) do --while having phirius tokens left
sendMacro("StoreBuyItem(1)"); yrest(1200); --Buy Charge
inventory:useItem(203487); yrest(500); --Use Charge
end;
sendMacro("CloseWindows();");
This should do the trick.
greets, herbee
Re: Compiling Error
Posted: Sun Oct 24, 2010 4:08 am
by Personalausweis
thanks a lot herbee.
its runnig now very good.