Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Broken Gambling Game and someone getting $35k+

Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-04-2003 23:02
Well today there was a big error in one of my gambling games in Perry. Someone found this error, which I still don't know what is, and took advantage of it to the tune of $35k +.

There are two things:
1. Could the person who did this please contact me. There is no way I can make you give me the money back but I *need* to know how it was cheated. If I can't figure it out there is a good chance many more of my games will close down temporarily until I do. This game was the number guessing game in perry.

2. This turn of events will seriously delay or cancel some very cool events and games I had planned - ones with cash prizes exceeding 25k. I just no longer have the means to do them. I am sorry that this effected so many people and I will make sure to run my games through a more rigourous test in the future and I will be building in some auto shut off features to prevent this from happening again.

PLEASE! If you know the bug, or know the person who took advantage of it, please contact me! I really wish there were tools in game to find this out but there just aren't.

- Ama Omega
Misnomer Jones
3 is the magic number
Join date: 27 Jan 2003
Posts: 1,800
08-04-2003 23:03
if they dont come forward, the Lindens should be able to figure it out.
_____________________
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-04-2003 23:08
Actually I will be able to tell tomorrow who it was.

They will be on or near the top of the weekly leader boards for networth, having just gone up by $35k+.
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-05-2003 00:15
The error has been found and squished I think. I still want to talk to the person and confirm what happened.

This was one of the first real tests of my Accounting script, a script that runs next to a game script to handle paying and collecting money and keeping track of how it all goes.

The error was in the collecting money part and the feature of the game that set the price. Because the Stocks have a very fluctuating price they never used this feature and hence no bugs.

I have fixed the bug, and walked through all my code with a fine toothed comb, line by line, case by case. I have also added two new features to this script. Those are payoutCap and lossCap. These two features allow the person using the Accounting script to set a limit on how much money the machine pays out and how much you can lose on it. Essentially you know what the max bet and max win is, so you set the max payout to that. You set the maxLoss to a number you think the game is still working if you go that much negative. Defaults are 1000 and 5000. If either of these cases occurs the game information is sent to the owner so they can check it out.

I am also now very interested in finding a script reader. I will pay them but they must be excellent at scripts and logic. Their job is to look at my code once I have written it and check it for stupidity. This is obviously worth a lot to me as I just lost 35k for it, so I will pay well. My initial candidates are Christopher Omega and Nada Epoch, but I will accept others. It will be tough though because I must trust you - you will be looking at my best code.

So, sorry for the trouble and the adverse effect this will have on the future of Omega Games. I hope to build back up to my previous financial level and beyond but it will not happen quickly.
Madox Kobayashi
Madox Labs R&D
Join date: 28 Jun 2003
Posts: 402
08-05-2003 02:45
Hey Ama - What a terrible turn of events, but at least its fixed now. I'd be happy to double check your code for you, looking for bugs. I wouldn't expect any payment other than that you do the same for me :) Oh and a large Madox Laboratories spinnng sign at Omega Games. jk :p

I don't know if you trust me though. As some Rose people like to point out, I spend all my time scripting and am more intersted in doing research and pushing scripting to the limits than in profits. So of course I'd like to see your code :p but if I can help advance the level and quality of scripts out there, thats certainly a job for Madox Laboratories :)
_____________________
Madox Kobayashi

Code Smith
Registered User
Join date: 24 Jun 2003
Posts: 40
08-05-2003 10:54
Ama did this also happen to the well in Taber? I noticed that the 'pot' dropped from ~$5000 to ~$1000 on each game... or did you reset them in an attempt to cover your losses? ;) The 'pot's on each of them had grown substantially in the previous days and I was looking forward to the dividends :(
Also, once you've determined the bug it would be great if you shared the details so any future or aspiring gaming script writers could avoid the same fate...

Oh yeah, btw, is anyone taking odds on which person on the leader board is the culprit ;)

-Code
Alondria LeFay
Registered User
Join date: 2 May 2003
Posts: 725
08-05-2003 19:55
I think you just inspired me to re-examine all my code and throw some safeguards in... That is really harsh, sorry to hear, Ama.
James Miller
Village Idiot
Join date: 9 Jan 2003
Posts: 1,500
08-05-2003 20:18
It appears to be TiamaT Titan. I had a long chat with me, and he does admit he has the money, but, he has no intention of giving it back, as according to him, it was won fairly. He proceded to curse me out and then threatened to report me to the Lindens for harrasment. :/

Sorry about this, Ama. Good luck :)
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-05-2003 22:43
Oooh lots of stuff.

First the *real* bug. It was not as I thought, the bug I found would have only allowed larger bets, and still been highly unlikely that someone would walk away 35k+ richer.

Here is the real bug. I had assumed that on entering a state the first thing that ran *always* is the state_entry(). I thought this is how it was documented, I thought this is how it worked. I was wrong. A queued up event, such as an llMessageLinked() from a button, can *reliably* pre-empt the state_entry event.

How does this effect my game, why did it hurt me so? My game has 2 basic states, running and playing. Running sits there waiting for someone to pay it, playing is where the game is played. So a person pays the game, and it jumps to playing. In the state entry of playing I pick a new random number, hide the old number and start a timer (so the game doesn't lock if someone leaves). And I have a link_message event handler to listen for the buttons being pressed.

If things worked as I thought they should it would be ok, but it turns out if you pay then click on the last number bet quick enough, the link_message event will get triggered before the state_entry event. And that means no new number has been picked and wala you get 5x your bet.

Luckily last night in addition to fixing the bug I thought I had I packed in some new features to my script as I mentioned before. And I am semi-glad to say that they work. The script allows you to set a maximum loss, if you lose more than that amount the game shuts off and IMs you the accounting details as well as the person who just played and the amount they won. This feature is the only reason I have any money now because even after I IMed the person they proceeded to work the game til it hit this loss cap.

The person who did this does not think he is in the wrong and really wanted a day to think about it before giving me any of my money back. I was asking for $30k of the near $38k that he won and offering help on making games for his casino (a huge thing in federal consiting of modified and unmodified versions of Philips slot machine), and even to make games for him. Thats an 8k bonus plus help to build his own games and get him rolling just for doing the right thing and helping me out. And really that is worth more than a 1 time 30k, in my opinion - taxes will eat that up in a matter of weeks generally. He really wanted a day to think about it and gave me $10k back as a good faith gesture to wait until tomorrow, when I hope we will talk again.

I am partially hoping for some linden intervention if I can't get more of my money back because I do feel the bug is largely their fault, even though I should have tested it better.

There is a chance I will have to do some consolidation even though I really don't want to. This has cost me the safety buffer that allowed me to have so many games with such high potential winnings (I have 4 Wells alone capable of legitly paying out $10k, not to mention my Jackpots and other games), and allowed me to expand and increase my offerings.

The end result
With the player it is undetermined right now.

However I now have a very, very robust and triple checked, tested and verified Accounting script that will not only handle money good but will prevent you being taken advantage of if there is an error in your other scripts. As I have shown from experience, that is worth a *lot*. I had planned on giving the script out for free but am no longer able to justify that. It is available for purchase with great benefits - lifetime upgrades and a limited gaurantee of functionaility. If you are interested see me in game.

Thanks for reading that long rambling post.
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-06-2003 00:59
I forgot all about Code Smiths post:

The Well being reset does *not* adversly effect dividends. The stock machine gets a message anytime someone pays or gets payed and keeps track by itself of the actual profit, not the pot amount.

Some time tomorrow I will try and post dividend payouts for the first week of stocks, sorry its so late. :)
Code Smith
Registered User
Join date: 24 Jun 2003
Posts: 40
08-06-2003 07:57
No problem... I had just assumed the bug was in the well game. I really hope the Lindens do the right thing here and give you your money back. Thanks for the info on the LSL bug. :)
Neo Valen
Registered User
Join date: 29 Jan 2003
Posts: 228
08-06-2003 13:16
lemme get this straight, it was ama who wrote the code, and somehow he shouod get his money back from the lindens? I dont see it that way, it was a bug in a script that was written by one specific individual, and therefore it also applies to real type gambling. There is a gambler and a gamblee, gamblig is a game of luck, and both parties take the chance of losing their shirts. I personally don't think gambling games should be refunded if the script that accepts people bets is bugged. How is that a Linden error? Just don't see how.
Grim Lupis
Dark Wolf
Join date: 11 Jul 2003
Posts: 762
08-06-2003 13:34
From: someone
Originally posted by Neo Valen
I personally don't think gambling games should be refunded if the script that accepts people bets is bugged. How is that a Linden error? Just don't see how.


The fact that state_entry() isn't the first event fired when changing states, despite the fact that the LSL docs say it is, is an error in the scripting language, or in the docs. Either way, it's a Linden error.
_____________________
Grim

"God only made a few perfect heads, the rest of them he put hair on." -- Unknown
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
08-06-2003 13:40
I actually agree with you Neo, a bug in my script should not be refunded by the lindens.

What I have posted is that I think the bug is at least partially a bug in their code. And that is the ordering of event handling isn't as advertised.

My LSL reference says this:
From: someone
state_entry()
The state_entry event occurs whenever a new state is entered, including program start, and is always the first event handled. No data is passed to handler.


That is a semi old manual though, has the text changed? I programmed my game based on the assumption that this was correct. The problem lies in that it is not correct. It is definatly not always the first event handled.

Now if the Lindens do not see it as their error for my money loss I will offer no complaint for them not helping me get my money back. In fact you will notice I didn't even ask for them to until I found out what the real bug was, which was after I thought I fixed it once (fixed something else).

I now have safe guards in so that it can never happen again, in the form of enhancements to my accounting script.

So to reiterate, I am not, and would never, seek help from lindens in getting money back due to an error on my part in my code. In this case I think the error was on their end and have thus submitted that information to them so they may review it. They may agree or dissagree. Either way I won't start a whine fest or protest or anything like that. I have also posted what exactly the error is, so that anyone else with a similar case can avoid problems.
RisingShadow Fallingbridge
Registered User
Join date: 1 Aug 2003
Posts: 149
free code reading
08-06-2003 13:59
Hey there. I just recently started the game so I'm not an expert on script writing...yet :D However, being a C++ and prolog coder in RL should give me a bit of a learning curve to it. I'm not promising that I will find all your bugs, but I would like a chance to look at some heavy duty script in the game. It'd give me a good chance to become familiar with this Linden script language. I've already read all the documentation and I've seen some scripts in action. However, I'm facinated with a script that manages money while the user is away.

If you don't trust me, that's fine. I'll still like to scan at your less vital scripts for bugs. Because I'm not a script guru yet I'm offering my services for about $5 a week. I can give you my word I will not copy or use the scripts that you show me. I may take notes on what certain functions do, but that would be it. If you an be interested in helping an eager learner out I'd really appreciate it. Heh, if nothing else, when I become better I'd be happy to help you script anything you need. So I guess you could look at this as an internship (yes I'd read and sign a contract with you if you wished, as long as it was fair).