|
Joined: Nov 2005
Posts: 15
Pikka bird
|
OP
Pikka bird
Joined: Nov 2005
Posts: 15 |
Ok ive got a few things i need helping with here. First of all on *:JOIN:#mychannel: { if ($chan = #mychannel ) {
//notice $nick Welcome to #mychannel Im the channels bot. For our latest deals type !deals. To get me
to idle in your channel type !idle #yourchan! } } Why does that code work? nothing happens (ive obv changed the mychannel bit) 2nd question - I have a peice of code that gets my bot to idle in peoples channels. on *:TEXT:!idle *:#: {
//msg $chan 2Im now idling in $2
//join $2 Works fine BUT when its in other peoples channels it also responds to !idle #channel. How do i get it to only accept idle commands from my channel? 3rd question Ive got a peice of code: on *:TEXT:!broadcast *:#:{ if ($nick isop $chan) { //amsg < $nick > $2- < #mychan > } } How do i get the >'s right next to nick? it appears as "< nickname >" i dont want any spaces, bur i move them next to it i nthe script, it wont show the nick, it just says <$nick> asif im asking it to display $nick> hope some people can help, thanks
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
In your first code, the if statement is irrelevant, since you specify the channel in the ON JOIN event. Aside from that, I see nothing wrong with that section of the code, however, here's the re-write on !*:join:#mychannel:{
notice $nick Welcome to $chan $+ . I'm the channels bot. For our latest deals type !deals. To get me to idle in your channel type !idle #yourchannel
} Regarding #2, you just need to specify the full channel name in the ON TEXT event, rather than using # (which will match whatever channel the bot is on). You already specify the specific channel in the ON JOIN event (reference question #1) A recommendation for an altered code reads as follows on *:text:!idle*:#mychan:{
if !$2 { .msg $nick You have to specify a channel }
elseif $2 ischan { .msg $nick I'm already in $2 }
else {
set %chan $2
join $2
}
}
on me:*:join:%chan:{
msg $chan,#mychan I'm now idling in $chan
} Regarding query #3, try this instead on *:TEXT:!broadcast *:#:{
if ($nick isop $chan) {
amsg $+(<,$nick,>) $2- <#mychan>
}
}
|
|
|
|
Joined: Jul 2006
Posts: 242
Fjord artisan
|
Fjord artisan
Joined: Jul 2006
Posts: 242 |
RE the first script, isnt there on = missing? "on *:JOIN:#mychannel: { if ($chan = #mychannel )" shouldnt it be " ($chan == #mychannel )?
Newbie
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
If the comparison was necessary, then you would be correct, although some people have been known to get correct results using the single = rather than the double ==. However, as I noted, since the channel name is specified in the ON JOIN event, that if statement is irrelevant.
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 400 |
RE the first script, isnt there on = missing? "on *:JOIN:#mychannel: { if ($chan = #mychannel )" shouldnt it be " ($chan == #mychannel )? no, if ($chan == #mychannel) is correct, but, I don't know why it's needed, it's already in the original script, so, it will only activate in the channel given, so, It's there for no reason.
-Kurdish_Assass1n
|
|
|
|
Joined: Jul 2006
Posts: 242
Fjord artisan
|
Fjord artisan
Joined: Jul 2006
Posts: 242 |
The if statment is not needed but it would have worked!! mark asked why his peace of code wasnt working so it was just something i noticed that i wanted to point out.
Newbie
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 400 |
lol HaleyJ, I thought u were talking about the 'if' not being there, didn't notice it had just one = sign, lol, sry.
-Kurdish_Assass1n
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Kurdish_Assassin: I just double checked the original post, and the IF command for the comparison is present (either that or I'm seeing things)
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 400 |
-Kurdish_Assass1n
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Yes { if ($chan = #mychannel ) {
|
|
|
|
Joined: Apr 2006
Posts: 400
Fjord artisan
|
Fjord artisan
Joined: Apr 2006
Posts: 400 |
lol, I know, I was talking about this one though, he said "shouldn't it be..." RE the first script, isnt there on = missing? "on *:JOIN:#mychannel: { if ($chan = #mychannel )" shouldnt it be " ($chan == #mychannel )?
Last edited by Kurdish_Assass1n; 21/07/06 01:04 AM.
-Kurdish_Assass1n
|
|
|
|
|