mIRC Home    About    Download    Register    News    Help

Print Thread
#127272 11/08/05 12:38 PM
Joined: Aug 2005
Posts: 15
M
Montana Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Aug 2005
Posts: 15
please make code
comman usage
!chan add #chan
!chan del #chan
!chan join list

write , read , control list.txt
please make $readini format

ON *:TEXT:*:#botchan: {
if ($1 = !chan) || ($2 = add) {
if ($3 isin .......) { exist.. )
write ....... i dont know writing format
}
if ($1 = !chan) || ($2 = del) {
write ....... i dont know writing and del format
}
if ($1 = !join) || ($2 = join) || ($2 = list) {
join -n $read .... list.txt "all chan"
}
}

Please help me

#127273 11/08/05 01:16 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
First, if you're displaying code here, please put it inside [ code ] and [ /code ] tags. It makes it easier to read.

Second, your answer:

Code:
on *:text:!chan *:*:{
  if ($2 == add && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) == $null) {
      write list.txt %chan
      .notice $nick $3 added to list.
    }
    else .notice $nick Channel already exists.
  }
  elseif ($2 == del && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) != $null) {
      write -dl $+ $readn list.txt
      .notice $nick $3 deleted from list.
    }
    else .notice $nick No channel on list.
  }
  elseif ($2 == join) {
    var %cnt = 1
    var %lines = $lines(list.txt)
    while (%cnt <= %lines) {
      join -n $read(list.txt,%cnt)
      inc %cnt
    }
  }
  else .notice $nick Invalid command.
}


Usage:

!chan add #channel
!chan del #channel
!chan join

Note that it will work if you use # in #channel or not. Also, note that it's not written to accept a list of #channels on a single !chan add line.

Now, this isn't set up for only one user to use. Or for only ops to use. If you don't want everyone to use it, you'll need to put in some method to prevent that. If you let me know who you want to use it (e.g. all ops, certain nicks, just you, etc), I can add that information into here if you're not sure how to.


Invision Support
#Invision on irc.irchighway.net
#127274 11/08/05 01:19 PM
Joined: Aug 2005
Posts: 15
M
Montana Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Aug 2005
Posts: 15
Quote:
First, if you're displaying code here, please put it inside [ code ] and [ /code ] tags. It makes it easier to read.

Second, your answer:

Code:
on *:text:!chan *:*:{
  if ($2 == add && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) == $null) {
      write list.txt %chan
      .notice $nick $3 added to list.
    }
    else .notice $nick Channel already exists.
  }
  elseif ($2 == del && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) != $null) {
      write -dl $+ $readn list.txt
      .notice $nick $3 deleted from list.
    }
    else .notice $nick No channel on list.
  }
  elseif ($2 == join) {
    var %cnt = 1
    var %lines = $lines(list.txt)
    while (%cnt <= %lines) {
      join -n $read(list.txt,%cnt)
      inc %cnt
    }
  }
  else .notice $nick Invalid command.
}


Usage:

!chan add #channel
!chan del #channel
!chan join

Note that it will work if you use # in #channel or not. Also, note that it's not written to accept a list of #channels on a single !chan add line.

Thank u verymuch Riamus2
smile Thank u

#127275 11/08/05 11:52 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Quote:
First, if you're displaying code here, please put it inside [ code ] and [ /code ] tags. It makes it easier to read.

Second, your answer:

Code:
on *:text:!chan *:*:{
  if ($2 == add && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) == $null) {
      write list.txt %chan
      .notice $nick $3 added to list.
    }
    else .notice $nick Channel already exists.
  }
  elseif ($2 == del && $3 != $null) {
    var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3)
    if ($read(list.txt,w,%chan) != $null) {
      write -dl $+ $readn list.txt
      .notice $nick $3 deleted from list.
    }
    else .notice $nick No channel on list.
  }
  elseif ($2 == join) {
    var %cnt = 1
    var %lines = $lines(list.txt)
    while (%cnt <= %lines) {
      join -n $read(list.txt,%cnt)
      inc %cnt
    }
  }
  else .notice $nick Invalid command.
}


Usage:

!chan add #channel
!chan del #channel
!chan join

Note that it will work if you use # in #channel or not. Also, note that it's not written to accept a list of #channels on a single !chan add line.

Now, this isn't set up for only one user to use. Or for only ops to use. If you don't want everyone to use it, you'll need to put in some method to prevent that. If you let me know who you want to use it (e.g. all ops, certain nicks, just you, etc), I can add that information into here if you're not sure how to.

Your script is hackable and it's not secure. It's same problem as in auto-join on invite.
Remember everytime to use the n switch at the read and readini, else the content will be evaluated smile

#127276 12/08/05 01:01 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
As I mentioned, the script could be used by everyone, which isn't a good idea and that I would make it work only for specific people if that is what he wants.

As far as 'n', yes, that is good to include if you are allowing multiple people to use it.


Invision Support
#Invision on irc.irchighway.net
#127277 12/08/05 04:35 PM
Joined: Aug 2005
Posts: 15
M
Montana Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Aug 2005
Posts: 15
oww is not and impsb. using !chan command all user
only by Botmaster grin Thx

Code:
 on  [color:red] BOTMASTER [/color]:text:!chan *:*:{ 
 if ($2 == add && $3 != $null) { 
   var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3) 
   if ($read(list.txt,w,%chan) == $null) {      
write list.txt %chan      
.notice $nick $3 added to list. 
   }
    else .notice $nick Channel already exists.
  }  
elseif ($2 == del && $3 != $null) {  
  var %chan = $iif($chr(35) !isin $3,$chr(35) $+ $3,$3) 
   if ($read(list.txt,w,%chan) != $null) { 
     write -dl $+ $readn list.txt   
   .notice $nick $3 deleted from list.
    }    else .notice $nick No channel on list. 
 }  elseif ($2 == join) { 
   var %cnt = 1    var %lines = $lines(list.txt)  
  while (%cnt <= %lines) {  
    join -n $read(list.txt,%cnt)   
   inc %cnt 
   }
  }
  else .notice $nick Invalid command.
}
 

#127278 12/08/05 05:46 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
It's ok then, but I still recommend you to add the n switch at read. Even if you are the only one who has access, a good bot would not let you evaluate smile


Link Copied to Clipboard