Field Commands
Field Commands are helpful "functions" that can be used in nearly any text fields in Pandemic's Script Creator (PSC).
Available Commands
Most Used Commands
Field Command | What it turns into |
---|---|
num(Number) , num(Variable Name) | this will format a number (or a variable's value) into a friendly text version (25000 would turn in to 25k, 1500000 would be 1.5M) |
hourly(Number) | an hourly rate of the given number based on how long your script has been running |
rand(a) | a random number between 0 (inclusive) and 'a' (exclusive) |
rand(a, b) | a random number between 'a' (inclusive) and 'b' (exclusive) |
randGaussian(mean, variance) | a random value sampled from the Gaussian distribution with the given parameters |
Variable Commands
Field Command | What it turns into |
---|---|
var(Variable Name) , v(Variable Name) | the variable's value |
lastOutput() | the last action's output as a string |
parameter(Parameter Name , p(Parameter Name) , param(Parameter Name) | inside of a custom action, this will be the parameter's value that was passed in |
list(List Variable Name) | the list as a comma separated string |
list(List Variable Name, Element Position) | the list item at the given position |
map(Map.Key) | the key's value in the given map |
prop(Variable Name, Property Name) , property(Variable Name, Property Name) | the variable's property value, can be used with any property with a Variable Property action |
size(List Variable Name) | the list's length |
timer(Timer Name) | the length of time remaining in a timer, formatted hh:mm:ss |
timerLong(Timer Name) | the length of time remaining in a timer, formatted Xd Xh Xm Xs |
json(Variable A, Variable B, ...) | a JSON object of all of the named variables, which can be loaded with Load Variables from JSON |
Item Commands
Field Command | What it turns into |
---|---|
profit() | the total value of the gained (or lost) amount of all tracked item gains and losses (this covers anything you've gained or lost) |
profit(Item Name, ...) | the total value of the gained (or lost) amount of the named item(s) |
invCount(Item Name, ...) | the amount of the named item(s) you currently have in your inventory |
bankCount(Item Name, ...) | the amount of the named item(s) your bank contains (this works when closed if it has been opened before while the script was running) |
itemGain(Item Name, ...) | the amount of the named item(s) you've gained (or lost) since the start of the script |
livePrice(Item Name or ID) | the current live price of the given item |
livePriceLow(Item Name or ID) | the current low live price of the given item |
livePriceHigh(Item Name or ID) | the current high live price of the given item |
highAlch(Item Name) | the high alch value of the given item |
Skill Commands
Field Command | What it turns into |
---|---|
skillLevel(Skill Name) | the real skill level |
expGain(Skill Name) | the amount of experience gained since the script started |
levelGain(Skill Name) | the amount of levels gained since the script started |
timeToLevel(Skill Name) | a formatted time left until you level up |
timeToLevel(Skill Name, Level) | a formatted time left until you reach the given level |
Math Commands
Field Command | What it turns into |
---|---|
add(a, b, ...) | the value of 'a' plus 'b' (plus 'c'... if more than 2 are provided) |
sub(a, b, ...) | the value of 'a' minus 'b' (minus 'c'... if more than 2 are provided) |
mul(a, b, ...) | the value of 'a' multiplied by 'b' (multiplied by 'c'... if more than 2 are provided) |
div(a, b, ...) | the value of 'a' divided by 'b' (divided by 'c'... if more than 2 are provided) |
sqrt(a) | the square root of 'a' |
pow(a, b) | the value of 'a' raised to the power of 'b' |
mod(a, b) | the remainder of 'a' divided by 'b' |
abs(a) | the absolute value of 'a' |
min(a, b, ...) | the smaller of 'a' and 'b' (and 'c'... if more than 2 are provided) |
max(a, b, ...) | the larger of 'a' and 'b' (and 'c'... if more than 2 are provided) |
round(a) | the value naturally rounded (1.4999 would be 1, 1.5001 would be 2) |
floor(a) | the value rounded down to the lower integer value (1.9999 would turn into 1) |
ceil(a) | the value rounded up to the higher integer value (1.0001 would turn into 2) |
Other Commands
Field Command | What it turns into |
---|---|
script() | the script's name |
version() | the script's current version as listed in the main action |
status() | the current action running, same as in the default paint |
runtime() | the current runtime of your script, formatted hh:mm:ss |
runtimeLong() | the current runtime of your script, formatted Xd Xh Xm Xs |
time() | the current time in milliseconds |
uuid() | a randomly generated UUID |
thread() | the current thread's name |