nevermind, local vars wont store their value threw custom event changes.
testing with this thingy to make entering quantities easier.
the $quantity var gets reset with each custom event change, as does the $price var
Code: Select all
Event( "&command" "test" )
{
*say price set to 5
$price=5
CustomEvent("numpad")
}
Event("custom", "numpad")
{
*say quantity $quantity - price $price
osdcreate(OSDBUILDING,"num","Employee Menu")
osdaddat(BIGTEXT, 25, 50, , , "", "Quantity $quantity")
if ($cost>0)
{
osdaddat(BIGTEXT, 25, 200, , , "", "Total Cost $cost")
}
if ($tax>0)
{
osdaddat(BIGTEXT, 25, 300, , , "", "(not including tax)")
}
osdaddat(BIGTEXT, 50, 65, , , "", "Type in the amount you desire")
osdaddat(OSDBUTTON, 100, 100, 50, 20, "num7", "7")
osdaddat(OSDBUTTON, 150, 100, 50, 20, "num8", "8")
osdaddat(OSDBUTTON, 200, 100, 50, 20, "num9", "9")
osdaddat(OSDBUTTON, 100, 150, 50, 20, "num4", "4")
osdaddat(OSDBUTTON, 150, 150, 50, 20, "num5", "5")
osdaddat(OSDBUTTON, 200, 150, 50, 20, "num6", "6")
osdaddat(OSDBUTTON, 100, 200, 50, 20, "num1", "1")
osdaddat(OSDBUTTON, 150, 200, 50, 20, "num2", "2")
osdaddat(OSDBUTTON, 200, 200, 50, 20, "num3", "3")
osdaddat(OSDBUTTON, 100, 250, 75, 20, "num0", "0")
osdaddat(OSDBUTTON, 175, 250, 75, 20, "num00", "00")
osdaddat(OSDBUTTON, 300, 100, 125, 50, "numreset", "Reset quantity")
osdaddat(OSDBUTTON, 300, 150, 125, 50, "numback", "Backspace")
osdaddat(OSDBUTTON, 300, 250, 125, 50, "numok", "Confirm")
osdaddat(OSDBUTTON, 300, 300, 130, 20, "exit", "Cancel")
osdactivate()
}
Event( "OSDSelect", "num:num1" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+1
}
if ($quantity=0)
{
$quantity=1
}
$cost=$quantity*$price
*say $quantity
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num2" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+2
}
if ($quantity=0)
{
$quantity=2
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num3" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+3
}
if ($quantity=0)
{
$quantity=3
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num4" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+4
}
if ($quantity=0)
{
$quantity=4
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num5" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+5
}
if ($quantity=0)
{
$quantity=5
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num6" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+6
}
if ($quantity=0)
{
$quantity=6
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num7" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+7
}
if ($quantity=0)
{
$quantity=7
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num8" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+8
}
if ($quantity=0)
{
$quantity=8
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num9" )
{
if ($quantity>0)
{
$quantity=$quantity*10
$quantity=$quantity+9
}
if ($quantity=0)
{
$quantity=9
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num0" )
{
if ($quantity>0)
{
$quantity=$quantity*10
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:num00" )
{
if ($quantity>0)
{
$quantity=$quantity*100
}
$cost=$quantity*$price
CustomEvent("numpad")
}
Event( "OSDSelect", "num:numreset" )
{
$quantity=0
$cost=0
CustomEvent("numpad")
}
Event( "OSDSelect", "num:numback" )
{
if ($quantity<10)
{
$quantity=0
}
if ($quantity>9)
{
$quantity=$quantity/10
}
$cost=$quantity*$price
CustomEvent("numpad")
}