Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ VBscript
➜ Error
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| WRTIII
Canada (76 posts) Bio
|
Date
| Sun 03 Apr 2005 06:15 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Sun 03 Apr 2005 06:48 AM (UTC) |
Message
| Where does your script get called (I don't see it anywhere).
And which line is line 55? |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| WRTIII
Canada (76 posts) Bio
|
Date
| Reply #2 on Sun 03 Apr 2005 06:56 AM (UTC) |
Message
| <triggers>
<trigger
group="DICE GAME"
match=""New game!", cries the manager of the dice table, "Place your bets now!""
name="BET"
script="dicecut"
sequence="100"
>
<send>bet 500</send>
</trigger>
</triggers>
Line 55: Wager = Wager + 500
I had removed the script call from the trigger, but the script would be called from pretty much all the triggers,
Triggers:
WINNER - Would Set the Variable to 500
CUT - Would Take the Varible and add 500 to it
LOSER - Would take the varible and double it
so actually just 3 calls I guess,
and a failsafe to make sure the varible if over 4000 is set to the number 4000
So I guess my triggers would look like this:
<triggers>
<trigger
enabled="y"
group="DICE GAME"
match=""Winner!, We have a winner!" cries the manager with excitement."
name="WINNER"
script="DICEWIN"
sequence="100"
sound="C:\Program Files\Ahead\Nero\Trumpet1.wav"
>
</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="*You tell the manager you would like to cut, and take back half your stake of"
name="CUT"
script="DICECUT"
sequence="100"
sound="C:\Program Files\Ahead\Nero\DingDong.wav"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
group="DICE GAME"
match=""New game!", cries the manager of the dice table, "Place your bets now!""
name="BET"
sequence="100"
>
<send>bet @wager</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Sun 03 Apr 2005 07:08 AM (UTC) |
Message
| Well, that second one is largely different than the first.
What's the problem then (and how would that script be called from the BET trigger? Since that's originally what caused the problem, yet it doesn't have the script call).
Check to make sure you've got a good value in the variable, since that seems to be whats causing the problem.
Also, calling the script AND sending something (that get's modified by the script) might end with results that you don't want) you might call and then send, or vice versa, I don't remember which way they get evaluated, it's somewhere around these forums though.
Since the script doesn't use any of the variables passed (line, name, wildcards) you could call it from within your 'send' box, to specify. Although that wouldn't cause this problem. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| WRTIII
Canada (76 posts) Bio
|
Date
| Reply #4 on Sun 03 Apr 2005 07:34 AM (UTC) |
Message
| <triggers>
<trigger
enabled="y"
group="DICE GAME"
match=""Winner!, We have a winner!" cries the manager with excitement."
name="WINNER"
script="DICEWIN"
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"
script="DICECUT"
sequence="100"
sound="C:\Program Files\Ahead\Nero\DingDong.wav"
>
</trigger>
<trigger
enabled="y"
expand_variables="y"
group="DICE GAME"
match=""New game!", cries the manager of the dice table, "Place your bets now!""
name="BET"
sequence="100"
>
<send>bet @wager</send>
</trigger>
</triggers>
<variables>
<variable name="WAGER">500</variable>
</variables>
Dim WAGER
Sub DICECUT (sName, sLine, wildcards)
WAGER = world.GetVariable ("WAGER")
WAGER = WAGER + 500
If WAGER > 4000 then
WAGER = 4000
End if
world.SetVariable "WAGER", WAGER
world.note WAGER
End Sub
Sub DICEWIN (sName, sLine, wildcards)
WAGER = world.GetVariable ("WAGER")
WAGER = 500
world.SetVariable "WAGER", WAGER
world.note WAGER
End Sub
Sub DICELOSE (sName, sLine, wildcards)
WAGER = world.GetVariable ("WAGER")
WAGER = WAGER * 2
If WAGER > 4000 then
WAGER = 4000
End if
world.SetVariable "WAGER", WAGER
world.note WAGER
End Sub
All Seems to be working now. thanks flannel | Top |
|
Posted by
| WRTIII
Canada (76 posts) Bio
|
Date
| Reply #5 on Sun 03 Apr 2005 08:15 AM (UTC) |
Message
| If Anyone is any good with odds..
It's a dice game.
Minimum Bet 500coins
Max Bet 4000 coins
The house rolls a single 6 sided dice
Then you either roll
Tie or Less you lose your bet
or you can CUT in which you get half your bet back
WAGER / 2 rounded down to the nearest 1
Right now
If the house rolls a 1 2 or 3 then I throw the dice
If the house rolls a 4 5 or 6 then I cut my losses
I start with a wager of 500
Anytime I win I reset my wager to 500
If I cut my dice then I take my wager that round and add 500 to it.
If I lose then I double my wager that round and double it.
WAGER WIN CUT LOSE
500 1000 1000 1000
1000 2000 1500 2000
1500 3000 2000 3000
2000 4000 2500 4000
2500 5000 3000 4000
3000 6000 3500 4000
3500 7000 4000 4000
4000 8000 4000 4000
If anyone knows a way to beat theese odds and how would be better to bet on this It would help
not too sure how my method will work or not, seems so far I am sitting pretty much even, but sitting more on the edge of slowly losing money.
thanks | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
20,080 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top