|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
I need an auto-voicer script that will voice anyone on channel join if the bot is opped, and I want certain nicknames to be able to turn it on and off. Is this possible? Also, I have a much more complicated project. When I type !market, I would like to have this information displayed in chat. So !lunarwars and I get Mineral Market Current Prices : Mineral: price Mineral: price
Last edited by Mpot; 24/04/07 12:31 AM.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Replace #channel with your channel name.
#autovoice on
on @*:join:#channel: {
mode $chan +v $nick
}
#autovoice end
on av:text:!av &:#channel: {
if ($2 == on) { .enable #autovoice }
elseif ($2 == off) { .disable #autovoice }
else .notice $nick Incorrect format. Use !av on or !av off.
}
Use: !av on !av off Then, you can put the people you want to have access to enable/disable that into your users list so it looks like this... av:nick!ident@host.com av:nick2!ident2@host2.com etc. You can use * in place of nick or ident or host if you want to.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
For your second script:
on *:text:!market:#channel: {
sockopen market www.lunarwars.net 80
}
on *:sockopen:market: {
sockwrite -n $sockname get /market.php HTTP/1.0
sockwrite -n $sockname User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)
sockwrite -n $sockname Host: www.lunarwars.net $+ $crlf $+ $crlf
}
on *:sockread:market: {
if ($sockerr) {
echo -a Error.
halt
}
else {
var %temptext
sockread %temptext
if (*strong* iswm %temptext) {
tokenize 32 $htmlfree(%temptext)
set %market %market 10 $+ $1 03 $+ $2
}
}
}
on *:sockclose:market: {
msg #channel 04Market: %market
unset %market
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
Change both #channel occurences to your channel and use !market to get the information. Feel free to change the colors/formatting.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
Thanks so much guys!
Also, for the !market, how can I make it work on any channel?
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Replace #channel in the ON TEXT event with just the # character.
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
What about the second part around sockcloes that says msg #channel ?
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
Anybody have an idea? Russel? Raimus?
Last edited by Mpot; 25/04/07 08:25 PM.
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
Russel, help?
Last edited by Mpot; 25/04/07 10:26 PM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
First off, bumping posts is frowned upon here. Secondly, bumping a post only a couple of hours after a post is (at best) frowned upon on any help forum. Thirdly, you would have to make a similar change anywhere #channel was specified.
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
Quite sorry, I didn't realize that it would be a problem. However, I tried changing msg #channel to msg $chan, but it didn't work. Also, I tried changed msg #channel to just msg #, but I got an error saying "LunarWars No such nick/channel".
Last edited by Mpot; 25/04/07 11:27 PM.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
ok. The point is, the final event on *:sockclose:market: {
msg #channel 04Market: %market
unset %market
} does not provide a $chan, it is not related to the initial on text-event. You have to store the place where "!market" had been typed manually. e.g. change: on *:text:!market:#channel: {
sockopen market www.lunarwars.net 80
} to: on *:text:!market:#channel: {
set -e %marketprices.chan $chan
sockopen market www.lunarwars.net 80
} and change: on *:sockclose:market: {
msg #channel 04Market: %market
unset %market
} to: on *:sockclose:market: {
if ($me ison %marketprices.chan) { msg $v2 04Market: %market }
unset %market | unset %marketprices.chan
} I am well aware that "/set" is not the neatest way to store temporary data like this, but you have to modify the given code least 
Last edited by Horstl; 26/04/07 12:36 AM.
|
|
|
|
Joined: Apr 2007
Posts: 228
Fjord artisan
|
OP
Fjord artisan
Joined: Apr 2007
Posts: 228 |
Thanks so much! That really means a lot to me.
Last edited by Mpot; 25/04/07 11:50 PM.
|
|
|
|
Joined: Apr 2007
Posts: 8
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Apr 2007
Posts: 8 |
on *:join:#:{ if (%avoice = on) { timer 1 5 mode $chan +v $nick } } ON *:TEXT:*:#: { if (!avoice * iswm $1-) && (on iswm $2-) { set %avoice on notice $nick autovoice ON } elseif (!avoice * iswm $1-) && (off iswm $2-) { set %avoice off notice $nick autovoice OFF } }
|
|
|
|
|
|