Page 2 of 2
Re: Counting shells in client 6.0.0+
Posted: Thu Jun 06, 2013 9:24 am
by barboza
Still nothing...
Code: Select all
Command> RomScript("GetPlayerPointInfo(1,1,\"\")")
onLoad error: [string "RomScript("GetPlayerPointInfo(1,1,\"\")")"]:1: attempt to
call global 'RomScript' (a nil value)
Command>
Re: Counting shells in client 6.0.0+
Posted: Thu Jun 06, 2013 9:31 am
by rock5
Sorry, RomScript is spelt RoMScript
Code: Select all
RoMScript("GetPlayerPointInfo(1,1,\"\")")
Re: Counting shells in client 6.0.0+
Posted: Thu Jun 06, 2013 3:44 pm
by Rickster
if you do not want to escape the " you can also use single quotes
Code: Select all
RoMScript('GetPlayerPointInfo(1,1,"")')
which causes the string not to be parsed.
Re: Counting shells in client 6.0.0+
Posted: Sat Jun 08, 2013 9:50 am
by grande
Hi, so if I just wanted to update Rock's code for say... one of the old CoTerror runs could I just do:
Code: Select all
function getCurrency(shell)
name = string.lower(name) -- Make lower case
local noSname = string.match(name,"^(.-)s?$") -- Take off ending 's'
local group, index
if noSname == "shell" or name == string.lower(getTEXT("SYS_MONEY_TYPE_11")) then
group, index = 1,1
elseif noSname == "energy" or noSname == "eoj" or name == string.lower(getTEXT("SYS_MONEY_TYPE_12")) then
group, index = 1,2
elseif noSname == "dreamland" or noSname == "pioneer sigil" or noSname == "sigil" or name == string.lower(getTEXT("SYS_MONEY_TYPE_10")) then
group, index = 1,3
elseif noSname == "mem" or noSname == "mento" or noSname == "memento" or name == string.lower(getTEXT("SYS_MONEY_TYPE_9")) then
group, index = 2,1
elseif noSname == "proof" or noSname == "pom" or name == string.lower(getTEXT("SYS_MONEY_TYPE_13")) then
group, index = 2,2
elseif noSname == "honor" or name == string.lower(getTEXT("SYS_MONEY_TYPE_4")) then
group, index = 3,1
elseif noSname == "trial" or noSname == "bott" or name == string.lower(getTEXT("SYS_MONEY_TYPE_8")) then
group, index = 3,2
elseif noSname == "warrior" or noSname == "botw" or name == string.lower(getTEXT("SYS_MONEY_TYPE_14")) then
group, index = 3,3
else
print("Invalid currency type. Please use 'shell', 'eoj', 'sigil', 'mem', 'proof', 'honor', 'trial' or 'warrior'.")
return 0,0
end
local amount, limit = RoMScript("GetPlayerPointInfo("..group..","..index..",\"\")")
return amount, limit-amount
if getCurrency(shell) > 899 then
loadPaths("buystats")
end
That should check that shells are at 900 and then load a path or do something else ?
Sorry, just trying to understand how this supplants:
Code: Select all
if inventory:itemTotalCount(240181) > 950 then
-- Wait for user to use some shells.
cprintf(cli.yellow,"Reaching the maximum number of Phirius Shells (1000). Please spend some before continuing.\n")
player:sleep()
numshells = inventory:getItemCount(240181)
end
Re: Counting shells in client 6.0.0+
Posted: Sat Jun 08, 2013 10:10 am
by rock5
Well once I've committed the new function, we can change it to
Code: Select all
if getCurrency("shell") > 950 then
-- Wait for user to use some shells.
cprintf(cli.yellow,"Reaching the maximum number of Phirius Shells (1000). Please spend some before continuing.\n")
player:sleep()
numshells = getCurrency("shell")
end
I'm not sure what effect having existing shells in your inventory will have though. Why did you use 900? The cost to play didn't change did it?
Tell you what, why don't I commit that function. Then I can update the minigame scripts.
Re: Counting shells in client 6.0.0+
Posted: Sat Jun 08, 2013 10:18 am
by grande
Awesome... rockin as always Rock! Thx!!
Oh, I was just messing around with some ideas to automate further is why I was looking at the 900.. so as in at 900 that would be 3 major stats... But the more I think about it, better just to go with the sleep option at 950 since there are too many variables (would I really want the major stats? maybe a lesser stat is needed... Then there would be other options such as what flavor stat... bleh... just wait/do it manually i guess)
I have a tendency to reach too far
Re: Counting shells in client 6.0.0+
Posted: Sun Jan 05, 2014 4:09 pm
by Lamkefyned
hello, I am making a script to make mine and points of honor and I want where they are already full to move to another waypoint and count them. as I do that?
Code: Select all
<!-- # 1 --><waypoint x="xxxx" z="xxxx" y="xx" tag="start" type="TRAVEL">
Re: Counting shells in client 6.0.0+
Posted: Tue Jan 07, 2014 3:49 am
by kuripot
ambolia wrote:hello, I am making a script to make mine and points of honor and I want where they are already full to move to another waypoint and count them. as I do that?
Code: Select all
<!-- # 1 --><waypoint x="xxxx" z="xxxx" y="xx" tag="start" type="TRAVEL">
check your other thread.. i try to help there