bind pub - !w ?pub_wuerfel
proc ?pub_wuerfel {nick userhost hand chan target} {
set num [rand 7]
if {$num > 0 && $target == ""} {
putchan $chan "--> $nick hat eine $num gewürfelt!" ;return 0}
if {$num > 0 && $target != ""} {
putchan $chan "--> $nick hat eine $num gewürfelt! (von $target Seiten)" ;return 0}
else {
putchan $chan "--> $nick ! Nur positive Zahlen eingeben! (z.B.: !w 78)" ;return 0}
}
When a user type only !w, the answer is [/color]"NICK hat eine "RANDOM Number" gewürfelt." Where a default dice only have 6 sides! [it means it cant display numbers higher then 6 or a 0]
But is he typing !w 666, it must display the same above, but with the attachment "(Von 666 Seiten)" in end of this line. (will means, the dice now has 666 sides)
last but not least:
Is he typing !w 0 or !w abc an error must displayed!
Well i hope any Germans are present here to understand my problem.
Greetz:
-{DFW}-DER_Wolle!
Notice: Falls jemand deutsch spricht und mir helfen kann, #dfw im Quarknet! Einfach Querie oder frag nach mir!
If you want a random value based on the number supplied by the user you better use that number when randomizing
Keep in mind that 'rand' returns a random number between 0 and the (positive) integer you feed it -1, so you better add 1 to the result, not to the number randomized if you want values from 1 to 6 returned.
Sorry, but can u specify that?
Im a n00b in this and i have to learn....
I also have read any tuts, but my english is very bad and mostly i cant understand anything... =(
*angry*
Thx for ur understandment...