Script request random number...

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Script request random number...

Post by Poi »

095

Could someone make a me a script that just makes a random number between 1 and 50, and sets it to a variable and if it turns out to be 7 create an item(Ill edit the item so for now just make it 0x0000) in the backpack of the person who won.. Thanks :d(Its for a voting script)
Firedancer
Grandmaster Poster
Posts: 104
Joined: Fri Feb 03, 2006 6:32 am

Re: Script request random number...

Post by Firedancer »

<e.g. some .textcommand...>

Code: Select all

use uo;
use os;
use util;

program randomstuff(who)
 
  var itemtocreate:=0x0000;
  var itemamount:=1;

  var randomnumber:=randomint(50)+1; //randomint(50) = 0....49
  if(randomnumber == 7)
    CreateItemInBackpack( who, itemtocreate, itemamount);
    sendsysmessage(who,"congrats...you won....uhm.. a nonexisting item");
  endif

endprogram
hope that helps
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Hmmm...
Firedancer your script brings up an interesting question.

Can one create a non-existing item? If the item doesn't exist after creation then was anything actually created?

The created item may exist in an alternate dimension and thus we might perceive it as being a non-existant item but I do not believe it is possible to create, in our dimension, an item that does not exist.

Care to offer any thoughts Firedancer?
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Thanks fire dancer, and uhh yukiko.. what the heck?
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

*laughs*

I was teasing Firedancer. In his script the sys message says "congrats...you won....uhm.. a nonexisting item".
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Hehe.. taking a while to test if it makes the item or not lol... Hope it does work though
Firedancer
Grandmaster Poster
Posts: 104
Joined: Fri Feb 03, 2006 6:32 am

Post by Firedancer »

hehe...
actually I guess the script will not work as long as the item-id is 0.... though I didn't want to confuse anyone by using a line of code like:

sendsysmessage(who,"congrats...you won....uhm.. an error message");

even though that would have been more accurate *laughs*

though back to answering your question, Yukiko: as the item does neither exist by definition nor has it been specified, I doubt it would be possible to have accidantly been created in other dimensions.... but then even if creating nothingness.... you might still have created something... even if that something is nothing.... wouldn't you agree? if god created the world, he had to create a lot of nothing after all as well.... *rofl*
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

It works ;)
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Yes Firedancer. I guess the question truly boils down to "Is nothing really something?"

*giggles*

I guess we'll leave that to the quantum physicists out there.
Marilla

Post by Marilla »

This thread hurts me head! :twisted:
Post Reply