Jump to content
MakeWebGames

Any one know of a mod that auto adds crystals to the crystal market like evey 5 mins


joker313

Recommended Posts

Got a five minute cron file?

If so, just add some code to it. Look in your crystal market file, the code where somebody adds crystals to the market. It's something like 'Insert into cmarket', or something like that.

Take that code. Change the userid of owner to 1 or whatever, and for amount of crystals instead of using an input from the user just use the php rand function.

If you wish to learn it, try to stumble through the guidelines I just posted. Or... you can wait till someone else does it for you.

Link to comment
Share on other sites

what about

Just insert it into the 5 minute cron, takes all of 5 minutes =P

db query the cmarket to update with points

have to find the exact call to the cmarket listing as i dno it off top of my head lemme go look.

EDIT:

K, that didnt work, let me mess with it a few mins :p

Link to comment
Share on other sites

OK, JUST FOR YOU ;) I got it working.

I tested this on my Minute Cron.

Insert right under

 

$c=$db->connection_id;

 

$rand=rand(1,5);
$price=$rand*5000;

 

The $rand is selecting a number between 1-5 and the Multiplier is Price. So if you want them to be cheaper, or more expensive alter these. 5*5000 = 25000 per POINT so that's 125k for 5 points. To alter that Change up the Rand integers or just lower the *5000 Multiplier.

Now, In your $db->queries

Insert this somewhere

$db->query("INSERT INTO crystalmarket VALUES('', $rand, 1, $price)");

 

And you're done, DAMN i finally learn to code and there's not +1's ;P

Link to comment
Share on other sites

OK, JUST FOR YOU ;) I got it working.

I tested this on my Minute Cron.

Insert right under

 

$c=$db->connection_id;

 

$rand=rand(1,5);
$price=$rand*5000;

 

The $rand is selecting a number between 1-5 and the Multiplier is Price. So if you want them to be cheaper, or more expensive alter these. 5*5000 = 25000 per POINT so that's 125k for 5 points. To alter that Change up the Rand integers or just lower the *5000 Multiplier.

Now, In your $db->queries

Insert this somewhere

$db->query("INSERT INTO crystalmarket VALUES('', 5, 1, 5000)");

 

And you're done, DAMN i finally learn to code and there's not +1's ;P

Your cmarket query is wrong. Shouldn't it be this?

 

$db->query("INSERT INTO crystalmarket VALUES('', $rand, 1, 5000)");

 

Not sure about the 5000, maybe it should be $price.

Also try to use mt_rand.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...