mIRC Home    About    Download    Register    News    Help

Print Thread
#75634 18/03/04 04:44 AM
Joined: Mar 2004
Posts: 8
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Mar 2004
Posts: 8
I thought I was doing better, but it seems not. Below are what should be two simple operations, but with various trys, and searches for answers, I have failed to get either to work... frown

*Note* %c=!, so the commands would be !dns xxxx and !calc 10*10

Code:
on 1:text:*dns*:#: {
  if ($1 == %c $+ dns) {
   if ($2 == $null) { .msg $chan Format is !dns yahoo.com }
    else { .msg $chan $2 is ($dns($2))
      halt
    }
  }
}
on 1:text:*calc*:#: {
  if ($1 == %c $+ calc) {
  .msg $chan Answer = ($calc($replace($2-,pi,3.14159265358979323846))) }
}
 


Again, thanks in advance for the help I know I will get. grin

#75635 18/03/04 11:20 AM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
on 1:text:$(%c $+ calc *):#: {
.msg $chan Answer $2- = $calc($replace($2-,pi,3.14159265358979323846))
}

Try to search the forums with !dns to get answer to that dns problem....


Code:
//if ( khaled isgod ) echo yes | else echo no
#75636 18/03/04 10:45 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
$calc($replace($2-,pi,$pi))

laugh

#75637 19/03/04 03:21 AM
Joined: Mar 2004
Posts: 8
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Mar 2004
Posts: 8
I've looked all over the forum, and mIRC help for help with the DNS one, but have not seen anything that I think will help me. I used theRat's solution to the !calc problem, and it works perfectly. :-)

#75638 19/03/04 06:51 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Try this out
Code:
on $*:text:/(dns|calc)/iS:#:{
  if $left($1,1) != %c { return }
  if $regml(1) == dns {
    if $0 < 2 { msg # Format is !dns yahoo.com }
    else {
      msg # Performing DNS on $2.
      set -u99 %dnshost. $+ $2 # DNS for $2:
      .dns $2
    }
    return
  }
  msg # Answer = $calc($replace($2-,pi,$pi))
}
on *:dns:{
  if $var($+(%,dnshost.,$dns(0).addr),1) {
    var %a = $($ifmatch,2)
    unset $ifmatch
    msg %a $iif($dns(1).ip,$ifmatch,Not resolved)
    halt
  }
  elseif $var($+(%,dnshost.,$dns(0).ip),1) {
    var %a = $($ifmatch,2)
    unset $ifmatch
    msg %a $iif($dns(1).addr,$ifmatch,Not resolved)
    halt
  }
}

#75639 20/03/04 04:14 AM
Joined: Mar 2004
Posts: 8
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Mar 2004
Posts: 8
ummmm, no. Didnt work.

on 1:text:*dns*:#: {
if ($1 == %c $+ dns) {
if ($2 == $null) { .msg $chan Format is !dns yahoo.com }
else { .msg $chan $2 is ($dns($2))
halt
}
}
}
I think I need just to get this part working?


Link Copied to Clipboard