mardi 24 février 2015

Randomizing script for HexChat IRC Client, in Python or Perl

I have a hunch that the answer to this is embarassingly easy, but nonetheless I can't figure it out (the fact that I don't know any of these languages at all might be the case). What I need is a script which would work this way:



  1. First, you type command like !random and a number from the range 1-100 (the number would mean the probability of success in %) [like this: !random 78]

  2. Then, it would - basing on given probability - choose whether you succeeded or not [for example, with !random 78, there is 78% probability that the outcome would be "Success"]

  3. Then, it would show on a channel a public message what the outcome is ("Success" or "Failure")


I need this one for online text RPG sessions. Also sorry for my bad English.





Aucun commentaire:

Enregistrer un commentaire