taltamir
Member
If you try to untinker an item you do not have via cli command "untinker name" then it tries to create the item first before untinkering it
Here is the gCLI output
Here is the code of the test function
Here is the gCLI output
Code:
> test.ash
counting batteries
[battery (AAA)] amount = 6
[battery (AA)] amount = 2
[battery (D)] amount = 0
[battery (9-Volt)] amount = 1
[battery (lantern)] amount = 0
[battery (car)] amount = 0
Verifying ingredients for battery (D) (1)...
Creating 1 meat paste...
You acquire an item: meat paste
You lose 10 Meat
Successfully created meat paste (1)
Creating battery (D) (1)...
You acquire an item: battery (D)
Successfully created battery (D) (1)
Untinkering battery (D)...
untinker 1 battery (D)
You acquire an item: battery (AAA)
You acquire an item: battery (AA)
Successfully untinkered battery (D)
Here is the code of the test function
Code:
void countBat()
{
print("counting batteries");
foreach it in $items[battery (AAA), battery (AA), battery (D), battery (9-Volt), battery (lantern), battery (car)]
{
print("[" +it+ "] amount = " +available_amount(it));
}
print("");
}
countBat();
cli_execute("untinker battery (D)");