|
Joined: Aug 2005
Posts: 15
Pikka bird
|
OP
Pikka bird
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
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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:
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
|
|
|
|
Joined: Aug 2005
Posts: 15
Pikka bird
|
OP
Pikka bird
Joined: Aug 2005
Posts: 15 |
First, if you're displaying code here, please put it inside [ code ] and [ /code ] tags. It makes it easier to read. Second, your answer:
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  Thank u
|
|
|
|
Joined: Aug 2005
Posts: 128
Vogon poet
|
Vogon poet
Joined: Aug 2005
Posts: 128 |
First, if you're displaying code here, please put it inside [ code ] and [ /code ] tags. It makes it easier to read. Second, your answer:
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 
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
|
|
|
|
Joined: Aug 2005
Posts: 15
Pikka bird
|
OP
Pikka bird
Joined: Aug 2005
Posts: 15 |
oww is not and impsb. using !chan command all user only by Botmaster  Thx 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.
}
|
|
|
|
Joined: Aug 2005
Posts: 128
Vogon poet
|
Vogon poet
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 
|
|
|
|
|