mIRC Home    About    Download    Register    News    Help

Print Thread
#88168 25/06/04 06:11 PM
Joined: Jun 2004
Posts: 3
D
demmy Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Jun 2004
Posts: 3
i am trying to make a script that does one of many things randomly but i cannot get it to function correctly any ideas how to fix it?
and can someone help me creat a script for quoting in a channel?
on *:action:*:huggles *:{
if ($me isin $2){
/var %randomnumber = $random()
if (%randomnumber < 0.5) {
/do $chan implodes
else {
/do $chan huggles back
}

#88169 25/06/04 06:37 PM
Joined: Apr 2004
Posts: 45
V
Ameglian cow
Offline
Ameglian cow
V
Joined: Apr 2004
Posts: 45
um, yuck. haha. sorry your code's just a bit off, I'll tweak it for you:

Code:
on *:action:huggles *:#: { 
if ($2 isin $me) {
/var %randomnumber = $rand(1,2)
if (%randomnumber == 1) {
/describe $chan implodes
else {
/describe $chan huggles back
}


should work for you. I switched to ($2 isin $me) because I assume you want it to work if they use part of your nick. in my case something like "huggles veno" should respond. you can also just use ($me == $2) if you want it only to respond to your entire nick.

-Venoman

#88170 25/06/04 07:02 PM
Joined: Jun 2004
Posts: 4
Z
Self-satisified door
Offline
Self-satisified door
Z
Joined: Jun 2004
Posts: 4
Hrm...you sure bout that tweak with "isin"? If they want it to do something when they use their nick, wouldn't make too much sense to look for the entire string inside the person's nick... Or maybe I read the manual wrong..


Yep. I dun gone there.
#88171 25/06/04 10:56 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Code:
on *:action:huggles *:#: {
  if ($2 == $me) {
    if ($rand(0,1)) describe $chan implodes
    else describe $chan huggles back
  }
}


For the test i'd need more information on what you want; i could even be
if ($regex($2-,$+(\b,$me,\b)) to check if your nick is a word in it; works even if it's surrounded by .,:;=+ etc

for the $rand change: if (0) is false, also if ($false) and if ($null) are false, all other text returns true, so if (1) is true, if (moo) is true and so on smile



Link Copied to Clipboard