Error number: -2146828275
Event: Execution of line 55 column 1
Description: Type mismatch: 'Wager'
Called by: Function/Sub: dicecut called by trigger
Reason: processing trigger "BET"
Sub Dicecut (sName, sLine, wildcards)
dim Wager
Wager = world.GetVariable ("Wager")
if isempty (Wager) then
world.note "My wager is not defined"
end if
if isnull (Wager) then
world.note "Invalid variable wager"
end if
Wager = Wager + 500
world.note Wager
world.SetVariable "Wager", Wager
End Sub
<triggers>
<trigger
enabled="y"
group="DICE GAME"
match=""Winner!, We have a winner!" cries the manager with excitement."
name="WINNER"
sequence="100"
sound="C:\Program Files\Ahead\Nero\Trumpet1.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat two to win!""
name="TWO"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat three to win!""
name="THREE"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat six to win!""
name="SIX"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat one to win!""
name="ONE"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="*"You lose", cries the manager, with unmistakable glee in his voice."
name="LOSER"
sequence="100"
sound="C:\Program Files\AIM95\Sounds\moo.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat four to win!""
name="FOUR"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat five to win!""
name="FIVE"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="*You tell the manager you would like to cut, and take back half your stake of"
name="CUT"
sequence="100"
sound="C:\Program Files\Ahead\Nero\DingDong.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match=""New game!", cries the manager of the dice table, "Place your bets now!""
name="BET"
sequence="100"
>
<send>bet 500</send>
</trigger>
</triggers>
The Minimum Bid is 500, Maxiumum 4000
I want to make it so when one of my triggers runs that makes me CUT DICE then It takes the wager value and adds 500
If it happens that I lose, Then it takes the wager value and multiples it by 2
If I win, then the wager value is reset back to 500
I need a check on each time it adjusts the wager so that if the value is over the Number 4000, It is set to 4000
any help would be appreciated, thanks
Event: Execution of line 55 column 1
Description: Type mismatch: 'Wager'
Called by: Function/Sub: dicecut called by trigger
Reason: processing trigger "BET"
Sub Dicecut (sName, sLine, wildcards)
dim Wager
Wager = world.GetVariable ("Wager")
if isempty (Wager) then
world.note "My wager is not defined"
end if
if isnull (Wager) then
world.note "Invalid variable wager"
end if
Wager = Wager + 500
world.note Wager
world.SetVariable "Wager", Wager
End Sub
<triggers>
<trigger
enabled="y"
group="DICE GAME"
match=""Winner!, We have a winner!" cries the manager with excitement."
name="WINNER"
sequence="100"
sound="C:\Program Files\Ahead\Nero\Trumpet1.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat two to win!""
name="TWO"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat three to win!""
name="THREE"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat six to win!""
name="SIX"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat one to win!""
name="ONE"
sequence="100"
>
<send>throw dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="*"You lose", cries the manager, with unmistakable glee in his voice."
name="LOSER"
sequence="100"
sound="C:\Program Files\AIM95\Sounds\moo.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat four to win!""
name="FOUR"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="* Throw the dice and beat five to win!""
name="FIVE"
sequence="100"
>
<send>cut dice</send>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match="*You tell the manager you would like to cut, and take back half your stake of"
name="CUT"
sequence="100"
sound="C:\Program Files\Ahead\Nero\DingDong.wav"
>
</trigger>
<trigger
enabled="y"
group="DICE GAME"
match=""New game!", cries the manager of the dice table, "Place your bets now!""
name="BET"
sequence="100"
>
<send>bet 500</send>
</trigger>
</triggers>
The Minimum Bid is 500, Maxiumum 4000
I want to make it so when one of my triggers runs that makes me CUT DICE then It takes the wager value and adds 500
If it happens that I lose, Then it takes the wager value and multiples it by 2
If I win, then the wager value is reset back to 500
I need a check on each time it adjusts the wager so that if the value is over the Number 4000, It is set to 4000
any help would be appreciated, thanks