Staredit Network

Staredit Network -> Staff Lounge -> Teh Future [v5]
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-02 at 15:16:23
I'm thinking of developing a new game for v5... SEN stocks. There's been quite a few suggestions for a stock-market type game, so I'd thought about planning one out and developing on it.

Basically, you can buy as many stocks in a "company" (we'll make those up... "Mad Moose Mineral Mining Co., etc... of course you'll all get one wink.gif) at the value of the stock (possibly with some % interest). At any time you like, you can sell your stock for that same value (again, possible with some % interest). Now, every 6 hours or something, the price of the stock can go up or down randomly... I'm still deciding how to work with this, if I want a percent based on current price, total value, or something else.

And this concludes the idea of my SEN Stock Market, which would be my first major attempt at programming... and that is it. Maybe I can even get a basic one running on v4 here, if v5 will be far off. Let me know if/where to start. smile.gif
Report, edit, etc...Posted by Yoshi da Sniper on 2005-06-02 at 16:09:13
I like that idea. Well, you could start right now, assuming you do not edit any of our current files (because your script is an include, which is considered a seperate part of the script. Your mistakes don't effect us, so you're guilt free). I think its okay, but you should ask IP too.
Report, edit, etc...Posted by chuiu on 2005-06-02 at 16:28:30
If you could somehow tie the occurances of randomization with posting (like everytime someone posts a random stock randomly goes up or down random amount tongue.gif) then it would make it a lot more interactive, especially during peek periods when there is a lot of people here posting.
Report, edit, etc...Posted by BeeR_KeG on 2005-06-02 at 20:08:21
I got an idea for making Stocks go up or down.

Make it based on post lenght. If the post is long, stock goes up, short it goes down and average, it just stays that way.

It's a good way to encourage longer, more intelligent posts.

About those Companies. Will there be only Companies for Staff/Admins or just anyone could buy one?
Report, edit, etc...Posted by chuiu on 2005-06-02 at 20:41:13
Has to depend on forum also, like places like Garbage would get ... much less for longer posts? tongue.gif
Report, edit, etc...Posted by IsolatedPurity on 2005-06-07 at 08:03:59
You could start on this right now if you wish, like yoshi said, however! Global scope code does change from time to time, sometimes effecting the rest of the site and changes need to be made in every script that is dependant on the global code.

One thing: Stocks need to go bankrupt from time to time and new stocks need to be made, from time to time. There needs to be a risk of loosing money. Overall though, the chance of loss is pretty low... if you diversify.

The script needs to be efficient with php server time and mysql queries...
It needs to fit in with the rest of sen's color scheme via the css... which does also sometimes change...
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-07 at 17:13:17
Yeah, I'll get started soon. I will have to edit index.php, naturally, just to add the usual line to make the code work within the SEN template/shell/whatever you call it.

Yes, bankruptcy will be a part of this. While there will be a lot of randomization, stocks will be able to go down, and they will be able to crash. Heck, I might even plant an Enron stock in there. tongue.gif

As for the efficency part, I'll try. I'll be using it as an index.php?act=meh so it will fit into the color scheme with the rest of the layout. As for the MySQL end of it, do we have phpMyAdmin or something? I would need to create a new table to store information on the stocks, amd probably add a new column or something to the members table to store information on the stock that the member owns.
Report, edit, etc...Posted by IsolatedPurity on 2005-06-08 at 13:18:23
Uh... senv5 is a lot more database driven... There is no reason for you to edit index.php to add a module. This isn't invision code. Although... I'm starting to wish I did it like theirs a little more, I have a problem I haven't been able to figure out how to get around yet.

I don't see a reason you need to be in any of the member tables.
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-08 at 14:00:27
I'm coding this for v4 first, which means yes, I would need to edit the index ( http://www.staredit.net/index.php?act=stocks )
Either way, if it doesn't go with the member's data, I still need somewhere to store the data. So, STOCKS ARE ON HOLD.

But, on a side note, I'm going to start with a smaller project first.

Just a simply lottery, let me explain.

The jackpot starts at 200 minerals and one ticket costs 10 minerals. Purchasing a ticket adds that much to the jackpot. With a ticket, you pick a number from 1-999 (or possibly 9999). If you hit the number, you get the 500 minerals. If you are within +/- 50 minerals of the number, you get a percentage of the jackpot based on how far your number was.
Let me use an example for that.
The number is 300, you picked 270.... 300-270 = 30, 30% of the money.
The number is 974, you picked 988.... 974-988 = -14, absolute value(-14)= 14, 14% of the money.

The only limits are, one ticket per person per drawing. And, if the jackpot falls below 200, it gets pushed back up to 200. I'd probably have it do a drawing every 6, 8, 12, or 24 hours. Tell me what you think of that idea. Its a lot simpler, and I think I'm better off starting with something smaller. wink.gif
Report, edit, etc...Posted by IsolatedPurity on 2005-06-08 at 14:08:16
Ah, okay.

Two tables: One to hold the stocks members bought and one to hold the actual stock data... one for logs perhaps.
I thought you had the login information for phpmyadmin... message me.


The lottery ticket is somewhat an alright of an idea, I'm thinking though it'll be too much of a money gain with those specific numbers.

I may do a more advanced lottery system for senv5... Like, real lottery. I don't know, to some degrees, I like yours better because it's more balanced... rather than one gets all. Work with it, tweak it, and we'll see.
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-08 at 22:08:18
Yeah, I'm just going to make the number from 0 to 9999. That should drastically cut the odds of profiting immensely. The only thing I'd have to think through is if lots of people win at once. Either first come, first serve, or dish out the cash before modifying the amount.

I started some work on it.... right now its a highly bastardized SEN Lots, but I'm starting to understand stuff. I downloaded the MySQL manual, I some reading to do if I want to use this thing properly. Hopefully when my skillz grow up, I can be like you IP. smile.gif
Report, edit, etc...Posted by Clokr_ on 2005-06-09 at 10:58:17
QUOTE(Mini Moose 2707 @ Jun 8 2005, 07:00 PM)
I'm coding this for v4 first, which means yes, I would need to edit the index ( http://www.staredit.net/index.php?act=stocks )
Either way, if it doesn't go with the member's data, I still need somewhere to store the data. So, STOCKS ARE ON HOLD.

But, on a side note, I'm going to start with a smaller project first.

Just a simply lottery, let me explain.

The jackpot starts at 200 minerals and one ticket costs 10 minerals. Purchasing a ticket adds that much to the jackpot. With a ticket, you pick a number from 1-999 (or possibly 9999). If you hit the number, you get the 500 minerals. If you are within +/- 50 minerals of the number, you get a percentage of the jackpot based on how far your number was.
Let me use an example for that.
The number is 300, you picked 270.... 300-270 = 30, 30% of the money.
The number is 974, you picked 988.... 974-988 = -14, absolute value(-14)= 14, 14% of the money.

The only limits are, one ticket per person per drawing. And, if the jackpot falls below 200, it gets pushed back up to 200. I'd probably have it do a drawing every 6, 8, 12, or 24 hours. Tell me what you think of that idea. Its a lot simpler, and I think I'm better off starting with something smaller. wink.gif
[right][snapback]229636[/snapback][/right]


Your calculus are wrong because if the number is 300 and you picked 299 you'll get 300-299 = 1% of the money, but if you picked 200 you would get 300-200 = 100% of the money!
The right calculus would be:

MoneyPercent = 100 - |Number - PickedNumber|

so if the number is 300 and you picked 270:
100 - |300 - 270| = 100 - |30| = 100 - 30 = 70%

and if the number is 974 and you picked 988:
100 - |974 - 988| = 100 - |-14| = 100 - 14 = 86%

You would have to check for negative percents if the picked number is too far from the right number, like if the number is 1 and the user picked 300:
100 - |1 - 300| = 100 - |-299| = 100 - 299 = -199%


Addition:
IP: To test PHP files do I have to upload them or can I execute them somehow on my computer?
Report, edit, etc...Posted by IsolatedPurity on 2005-06-09 at 12:44:37
You can test them on your computer if you have apache and php installed as services... or you can upload them to a server that can execute php code.
Report, edit, etc...Posted by BeeR_KeG on 2005-06-09 at 15:53:19
To my understanding, it would be easier to just find a Free Host that has those 2 services. I don't thinkt hat it's easy to install those in your PC.
But then again, I have never tried to install those.

I think it's about time I started to learn some PHP. Off to http://www.phpfreaks.com/ they got this massive manual with everything in it!
Report, edit, etc...Posted by Clokr_ on 2005-06-09 at 17:18:32
Bleh I'm too lazy to upload them to test them and I don't want to install more shit on my computer that I'm not gonna use more than twice.
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-09 at 17:51:55
Yeah, hitting the number for 500 minerals was it a type. It should say 100% of the minerals. tongue.gif
Clokr_, there is nothing wrong with my math. You did not consider the domain. you wouldn't get 100% of the money by being 100 away. If you read my post, notice it says within +/- 50 of the number.
Report, edit, etc...Posted by IsolatedPurity on 2005-06-09 at 20:15:39
um...
anyways!


Beer: I find php.net a lot more easy to use. phpfreaks is just a wanna be copy of php.net with more user interaction with forums and such. Their manual is only a rip off of php.net's. Plus, the user contributed notes on php.net are usually helpful. mysqlfreaks don't even have a search function, or at least none that i can find, compared to mysql.com.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-06-09 at 20:51:13
Ok answer me this . . .

Why the F**K do people spell the, "teh"
Report, edit, etc...Posted by BeeR_KeG on 2005-06-09 at 20:58:05
QUOTE(isolatedpurity @ Jun 9 2005, 08:15 PM)
um...
anyways!
Beer:  I find php.net a lot more easy to use.  phpfreaks is just a wanna be copy of php.net with more user interaction with forums and such.  Their manual is only a rip off of php.net's.  Plus, the user contributed notes on php.net are usually helpful.  mysqlfreaks don't even have a search function, or at least none that i can find, compared to mysql.com.
[right][snapback]231023[/snapback][/right]


I've gone through a few of the first Tutorials and compared the two.
PHPFreaks tells you what it does and thats it.

PHP.net tells you what it does and why it does it and some nice ways to use them.

Thanks for the suggestion.

QUOTE
Why the F**K do people spell the, "teh"


Teh is a mispell of The. It's pretty similar for when you write adn instead of and. You just write too fast.
Now why people keep using the mispellings instead of the correct word, it's more of a choice to have a little fun and be a bit different I'd guess.

I like to use woned instead of owned.
Report, edit, etc...Posted by chuiu on 2005-06-09 at 23:27:26
QUOTE((U)Bolt_Head @ Jun 9 2005, 07:51 PM)
Ok answer me this . . .

Why the F**K do people spell the, "teh"
[right][snapback]231052[/snapback][/right]

The same reason people say pwn instead of own.
Report, edit, etc...Posted by IsolatedPurity on 2005-06-13 at 12:59:10
So how's it coming moose?
Report, edit, etc...Posted by Mini Moose 2707 on 2005-06-13 at 19:02:58
Haven't gotten much time yet. I'm currently reading the MySQL manual... I found out what type of data the coulmns of my table will store. Small Integers. thumbup.gif I really need to settle down and put some time into this... unfortunately not much is available now. It will be soon, though. smile.gif
Next Page (1)