mIRC Home    About    Download    Register    News    Help

Print Thread
#143878 03/03/06 03:51 AM
Joined: Dec 2004
Posts: 33
W
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Dec 2004
Posts: 33
i am usally away from home but i would like my home computer to join, part, change nick, kick, ban etc... only a few commands. i do not want to install a bot script. the command would be in msg. like this:
!nick WildCard <<to change nick to wildcard>>
!part #channel
!join #channel
!identify password

how would this be scripted on my home computer? if i can get the basic function i can just copy and paste for each command. thank you for your time

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
/help on text

-genius_at_work

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
All commands sent through private message/query. The code goes in remote scripts (alt + r).

You may need to change the red colored text. I just assume the network you are on uses NickServ, if not then change it as needed.

At the bottom is a commented out skeleton code for adding another command. It should be easy to figure out. Be sure to remove the semi-colons if copying the code.

Code:
on *:TEXT:*:?:{
  [color:green]; !join #channel / !part #channel[/color]
  if ($regex($2,/^#[\S]/)) {
    if ($1 == !join) {
      if ($me !ison $2) join $2
      else .msg $nick I am already on $2
    }
    if ($1 == !part) {
      if ($me ison $2) part $2
      else .msg $nick I am not on $2
    }
  }
  [color:green]; !nick &lt;new-nick&gt;[/color]
  if ($1 == !nick) {
    if ($2 &amp;&amp; $regex($2,/^[a-zA-Z\[\]\{\}\\`^]/)) { nick $2 }
    else .msg $nick Invalid nick.
  }
  [color:green]; !identify[/color]
  if ($1 == !identify) .msg [color:red]NickServ identify nick pass[/color]

  [color:green]; if ($1 == !new-command) {
  ; do stuff here
  ; }[/color]
}

Joined: Jan 2003
Posts: 1,063
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
you should rather use elseif instead of if's here...

mIRC will try and evaluate all the if's you put in here what is useless, it should stop at the one it was looking for...


so:

if
elseif
elseif
elseif
else

is a much better construction


If it ain't broken, don't fix it!

Link Copied to Clipboard