mIRC Home    About    Download    Register    News    Help

Print Thread
#227673 18/11/10 12:37 AM
Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
Hey Forum,

I have a dicebot and wish to place two tweaks on it.

1- I want it to be able to idle in multiple rooms but only be actively working in the one i choose.

2- After everyone gives their init, i'd like the bot to be able to put them in order so we dont have to fiddle around finding out who goes first.

Here is my simple bot


menu nicklist {
Dice [ %DS ]
.ON:/set %DS ON | .enable #dice
.OFF:/set %DS OFF | .disable #dice
.-
}
#dice on

menu nicklist {

roll
.dice:/set %sdce 0 | /dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
.Sdice:/set %sdce 1 | /dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
.Xdice:/set %sdce 2 | /dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
.Init:/init $?="# of dice in dex" $$?="# of dots in wits"
.Spirit of Fray init:/sinit $?="# of dice in dex" $$?="# of dots in wits" $$?="Gnosis rating"

}

on *:text:!dice*:#:/set %sdce 0 | /dice $2 $3 $nick $4-
on *:text:!sdice*:#:/set %sdce 1 | /dice $2 $3 $nick $4-
on *:text:!xdice*:#:/set %sdce 2 | /dice $2 $3 $nick $4-
on *:TEXT:!init*:#:/init $2 $3
on *:TEXT:!sinit*:#:/sinit $2 $3 $4


alias dice {
/unset %curroll
/unset %total
/set %scc 0
/set %btch 0
/set %tn 0
/set %nin 0
/set %rt 0
/set %rp $1
/set %ru $1
/set %dff $2
:roll
if (%rt < %ru) { /set %curroll $rand(1,10) | /set %total %total 12-14 %curroll | inc %rt | goto eval }
else { goto eval2 }
:eval
if (%curroll >= %dff) { /inc %scc 1 }
if (%curroll == 1) { /inc %btch 1 }
if (%curroll == 10) { /inc %tn 1 }
if (%curroll == 9) { /inc %nin 1 }
goto roll
:eval2
if (%sdce == 0) { goto post }
elseif (%sdce == 1) { goto sdice }
elseif (%sdce == 2) { goto xdice }
:sdice
/set %rt 0
/set %ru %tn
/set %total %total 12[5rerolling14 %tn 5tens12]5=
:sroll
if (%rt < %ru) { /set %curroll $rand(1,10) | /set %total %total 12-14 %curroll | inc %rt | goto eval3 }
else { goto post }
:eval3
if (%curroll >= %dff) { /inc %scc 1 }
if (%curroll == 10) { /inc %ru 1 }
goto sroll
:xdice
/set %rt 0
/set %ru $calc(%tn + %nin)
/set %total %total 12[5rerolling14 %nin 5nines &14 %tn 5tens12]5=
:xroll
if (%rt < %ru) { /set %curroll $rand(1,10) | /set %total %total 12-14 %curroll | inc %rt | goto eval4 }
else { goto post }
:eval4
if (%curroll >= %dff) { /inc %scc 1 }
if (%curroll >= 9) { /inc %ru 1 }
goto xroll
:post
/set %tscc [ %scc - %btch ]
if (%tscc >= 1) { /set %result Success!!! | goto post2 }
elseif (%tscc < 1) { /set %result Fail!!! | goto botch }
:botch
if ( %scc <= 0 ) && ( %btch >= 1 ) { /set %result BOTCH!!!! | goto post2 }
else { goto post2 }
:post2
/describe # $nick rolls14 %rp 12dice at a difficulty of14 %dff 12to:14 $4-
/describe # %total
/describe # 14success's =12 %scc 14Botches =12 %btch 5:14Total =12 %tscc 14Result12 %result
halt
}
alias init {
unset %calc
unset %rand
set %rand $rand(1,10)
set %calc $calc($1 + $2 + %rand)
/describe # 14 $nick $+ 's Dex:12 $1 $+ ,14 Wits:12 $2 14plus Init Roll:12 %rand $+ . 14Initiative =12 %calc
halt

}

alias sinit {
unset %calc
unset %rand
set %rand $rand(1,10)
set %calc $calc( 10 + $1 + $2 + (10*$3) + %rand )
/describe # 14 $nick $+ 's Dex:12 $1 $+ , 14Wits:12 $2 $+ , 14Init Roll:12 %rand $+ ,14 Gnosis extra:12 $3 14(times 10), Spirit of the Fray (Auto 10). Initiative =12 %calc
halt

}

#Dice off


Thanks for the help guys smile

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
To set it to a specific channel, put the channel name in the on text events (instead of just #, which means all channels). Next, remove all of those /'s as they are not necessary. And then please put it all inside [ code ] tags on the forum so we can read it more easily. From there, someone can help to get the output the way you want.


Invision Support
#Invision on irc.irchighway.net
Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
I do appologize, I know very little when it comes to scripting so I simply copy/pasted it from the.ini file I had. I will try to fix it so its easier to read.

I cant seem to edit my original post to fix it into code brackets....even though I wasnt sure how to do that in the first place XD

Last edited by Syrth; 19/11/10 04:24 AM.
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Code:
menu nicklist {
  Dice [ %DS ]
  .ON: {
    set %DS ON 
    .enable #dice
  }
  .OFF: {
    set %DS OFF 
    .disable #dice
  }
  .-
}
#dice on

menu nicklist {

  roll
  .dice: {
    set %sdce 0 
    dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
  }
  .Sdice: {
    set %sdce 1 
    dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
  }
  .Xdice: {
    set %sdce 2 
    dice $?="how many dice" $$?="difficulty" $$me $?="what are you doing or leave blank"
  }
  .Init: init $?="# of dice in dex" $$?="# of dots in wits"
  .Spirit of Fray init: sinit $?="# of dice in dex" $$?="# of dots in wits" $$?="Gnosis rating"
}

on *:text:!dice*:#: {
  set %sdce 0 
  dice $2 $3 $nick $4-
}
on *:text:!sdice*:#: {
  set %sdce 1 
  dice $2 $3 $nick $4-
}
on *:text:!xdice*:#: {
  set %sdce 2 
  dice $2 $3 $nick $4-
}
on *:TEXT:!init*:#: init $2 $3
on *:TEXT:!sinit*:#: sinit $2 $3 $4


alias dice {
  unset %curroll
  unset %total
  set %scc 0
  set %btch 0
  set %tn 0
  set %nin 0
  set %rt 0
  set %rp $1
  set %ru $1
  set %dff $2
  :roll
  if (%rt < %ru) { 
    set %curroll $rand(1,10) 
    set %total %total 12-14 %curroll 
    inc %rt 
    goto eval 
  }
  else goto eval2
  :eval
  if (%curroll >= %dff) { inc %scc 1 }
  if (%curroll == 1) { inc %btch 1 }
  if (%curroll == 10) { inc %tn 1 }
  if (%curroll == 9) { inc %nin 1 }
  goto roll
  :eval2
  if (%sdce == 0) { goto post }
  elseif (%sdce == 1) { goto sdice }
  elseif (%sdce == 2) { goto xdice }
  :sdice
  set %rt 0
  set %ru %tn
  set %total %total 12[5rerolling14 %tn 5tens12]5=
  :sroll
  if (%rt < %ru) { 
    set %curroll $rand(1,10) 
    set %total %total 12-14 %curroll 
    inc %rt 
    goto eval3 
  }
  else goto post
  :eval3
  if (%curroll >= %dff) { inc %scc 1 }
  if (%curroll == 10) { inc %ru 1 }
  goto sroll
  :xdice
  set %rt 0
  set %ru $calc(%tn + %nin)
  set %total %total 12[5rerolling14 %nin 5nines &14 %tn 5tens12]5=
  :xroll
  if (%rt < %ru) { 
    set %curroll $rand(1,10) 
    set %total %total 12-14 %curroll 
    inc %rt 
    goto eval4 
  }
  else goto post
  :eval4
  if (%curroll >= %dff) { inc %scc 1 }
  if (%curroll >= 9) { inc %ru 1 }
  goto xroll
  :post
  set %tscc [ %scc - %btch ]
  if (%tscc >= 1) { 
    set %result Success!!! 
    goto post2 
  }
  elseif (%tscc < 1) { 
    set %result Fail!!! 
    goto botch 
  }
  :botch
  if ( %scc <= 0 ) && ( %btch >= 1 ) { 
    set %result BOTCH!!!! 
    goto post2 
  }
  else goto post2
  :post2
  describe # $nick rolls14 %rp 12dice at a difficulty of14 %dff 12to:14 $4-
  describe # %total
  describe # 14success's =12 %scc 14Botches =12 %btch 5:14Total =12 %tscc $&
    14Result12 %result
  halt
}
alias init {
  unset %calc
  unset %rand
  set %rand $rand(1,10)
  set %calc $calc($1 + $2 + %rand)
  describe # 14 $nick $+ 's Dex:12 $1 $+ ,14 Wits:12 $2 14plus Init Roll:12 %rand $+ . $&
    14Initiative =12 %calc
  halt

}

alias sinit {
  unset %calc
  unset %rand
  set %rand $rand(1,10)
  set %calc $calc( 10 + $1 + $2 + (10*$3) + %rand )
  describe # 14 $nick $+ 's Dex:12 $1 $+ , 14Wits:12 $2 $+ , 14Init Roll:12 %rand $+ ,14 $&
    Gnosis extra:12 $3 14(times 10), Spirit of the Fray (Auto 10). Initiative =12 %calc
  halt

}

#Dice off



That makes it a little easier to read, and removed all the unnecessary /'s and |'s for you. Although I know it can be done the way it was, I prefer to lay out scripts like this so they're easier to follow (thus easier to troubleshoot).

Last edited by CtrlAltDel; 19/11/10 02:58 PM.

I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
ohh thank you very much!!

I managed to put in the room name as explained THANK YOU ALOT

Now im hoping someone can help with the :

2- After everyone gives their init, i'd like the bot to be able to put them in order so we dont have to fiddle around finding out who goes first.

Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
That would require more than my minimal scripting knowledge, sorry.


I refuse to engage in a battle of wits with an unarmed person. wink
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Reviewing code for alterations to accommodate request and improve code. There are a lot of GOTO's in that code and they make the code harder to follow.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
What should the bot wait for before announcing who is next, and what should happen if two or more users have the same init level?

With these two questions answered, I should have a finished code for you within an hour.

Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
omg Russell your awesome!!!

hmm Would a simple command be sufficiant enough to make it tell us who,s next? and would there be a way to reset it in case there is another battle to follow?

If you need to pm me I can give you a nickname to contact on Sorcery or DarkMyst

Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
Let me know how to contact you since your pmbox is full! ^.^

Thanks again!!

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
A simple command (eg: !next) would be sufficient to get the name of the next person/player.

A reset command could be done. I'm guessing that !reset (as an example) would basically just run the init section for everyone.

As to my pm box, thanks for letting me know, I don't look at it too often and didn't realize it was full.

Please clarify what you want for the commands and what you want the reset command to do. (eg: init and/or sinit for everyone, or make all variables set to zero.

Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
Hi Russel smile

!next sounds perfect

!reset woukld be great too because sometimes there are like 3 battles to take place and they arent always the same players so they have to redo their inits. I think back to 0 so they can reroll but your the expert here smile

if there was a way to see a list like below in case we just want to make sure everyone's in there. like below

Shirley, Bob, Gordon, Peris


Thanks again for all the help

Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
Hope everything is well on your side and that you had a great thanksgiving dinner!

Joined: Nov 2010
Posts: 8
S
Syrth Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
S
Joined: Nov 2010
Posts: 8
Hey Russel,

I hope your still around smile Looking forward to hearing from you!

Thanks so much smile


Link Copied to Clipboard