mIRC Home    About    Download    Register    News    Help

Print Thread
Auto-Voice Script #175517 24/04/07 12:20 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
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.
Re: Auto-Voice Script [Re: Mpot] #175519 24/04/07 12:46 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Replace #channel with your channel name.
Code:
#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
Re: Auto-Voice Script [Re: Mpot] #175522 24/04/07 01:02 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
For your second script:

Code:
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,&nbsp;)
  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
Re: Auto-Voice Script [Re: Riamus2] #175548 24/04/07 08:45 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Thanks so much guys!

Also, for the !market, how can I make it work on any channel?

Re: Auto-Voice Script [Re: Mpot] #175555 25/04/07 12:05 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Replace #channel in the ON TEXT event with just the # character.

Re: Auto-Voice Script [Re: RusselB] #175556 25/04/07 12:08 AM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
What about the second part around sockcloes that says msg #channel ?

Re: Auto-Voice Script [Re: Mpot] #175601 25/04/07 08:13 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Anybody have an idea? Russel? Raimus?

Last edited by Mpot; 25/04/07 08:25 PM.
Re: Auto-Voice Script [Re: Mpot] #175608 25/04/07 10:07 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Apr 2007
Posts: 228
Russel, help?

Last edited by Mpot; 25/04/07 10:26 PM.
Re: Auto-Voice Script [Re: Mpot] #175614 25/04/07 10:29 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
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.

Re: Auto-Voice Script [Re: RusselB] #175618 25/04/07 11:21 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
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.
Re: Auto-Voice Script [Re: Mpot] #175620 25/04/07 11:40 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
ok. The point is, the final event
Code:
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:
Code:
on *:text:!market:#channel: {
  sockopen market www.lunarwars.net 80
}

to:
Code:
on *:text:!market:#channel: {
set -e %marketprices.chan $chan
  sockopen market www.lunarwars.net 80
}


and change:
Code:
on *:sockclose:market: {
  msg #channel 04Market: %market
   unset %market
}

to:
Code:
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 smile

Last edited by Horstl; 26/04/07 12:36 AM.
Re: Auto-Voice Script [Re: Horstl] #175623 25/04/07 11:44 PM
Joined: Apr 2007
Posts: 228
M
Mpot Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
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.
Re: Auto-Voice Script [Re: Mpot] #175724 27/04/07 02:30 PM
Joined: Apr 2007
Posts: 8
S
sdgsgsdgsgsd Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
S
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
}
}