This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

need help for small url script

Old posts that have not been replied to for several years.
Locked
w
wipo

need help for small url script

Post by wipo »

first of all, im new here and my english sucks a little :P
I have a little problem. I need a simple tcl what do a little command for me.

For example.
If i do !blaat the bot give me a url. he just have to give me a url i selected.
I want a couple of !commands, maybe 3 or so and each of them will give me the url i have early bind to that ! command

Does this script exist ? (i can't script but i think this is a very small script ? or am i wrong :lol:
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

i imagine that the tcl archive @ egghelp.org is full of pub command scripts. if you are unable to obtain one, someone will post a solution
photon?
w
wipo

Post by wipo »

Yes there are a lot op pub command tcl scripts at the tcl section. ive seen them all, but all the scripts have to many functions like !op !deop etc. all sort of that. but that stuff i don't wanna have at the same tcl i already have some sort of that.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

bind pub - !bla post_the_url
bind pub - !bla2 post_the_url
bind pub - !bla3 post_the_url

set url(1) "http:www.bla.com"
set url(2) "http:www.bla.org"
set url(3) "http:www.bla.net"

proc post_the_url {nick host hand chan arg} {
  global lastbind url
  switch -exact -- $lastbind {
    "!bla" { putserv "PRIVMSG $nick :$url(1)" }
    "!bla2" { putserv "PRIVMSG $nick :$url(2)" }
    "!bla3" { putserv "PRIVMSG $nick :$url(3)" }
  }
}
this should do the trick
Elen sila lúmenn' omentielvo
w
wipo

Post by wipo »

Papillon wrote:

Code: Select all

bind pub - !bla post_the_url
bind pub - !bla2 post_the_url
bind pub - !bla3 post_the_url

set url(1) "http:www.bla.com"
set url(2) "http:www.bla.org"
set url(3) "http:www.bla.net"

proc post_the_url {nick host hand chan arg} {
  global lastbind url
  switch -exact -- $lastbind {
    "!bla" { putserv "PRIVMSG $nick :$url(1)" }
    "!bla2" { putserv "PRIVMSG $nick :$url(2)" }
    "!bla3" { putserv "PRIVMSG $nick :$url(3)" }
  }
}
this should do the trick
wow i really needed this, thx a lot, very nice of you, thx :)
one small thing, is it possible to only show this to group of persons ? i have a normal channel and a private channel, and people in the normal aren't allowed tho see the urls. can i bind it to 1 channel, so !bla only works in one channel and not in both ?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

Code: Select all

bind pub - !bla post_the_url 
bind pub - !bla2 post_the_url 
bind pub - !bla3 post_the_url 

set url(1) "http:www.bla.com" 
set url(2) "http:www.bla.org" 
set url(3) "http:www.bla.net" 
set url(channel) "#somechannel"

proc post_the_url {nick host hand chan arg} { 
  global lastbind url 
  if {[string tolower $chan] != $url(channel)} {return 0}
  switch -exact -- $lastbind { 
    "!bla" { putserv "PRIVMSG $nick :$url(1)" } 
    "!bla2" { putserv "PRIVMSG $nick :$url(2)" } 
    "!bla3" { putserv "PRIVMSG $nick :$url(3)" } 
  } 
}
Elen sila lúmenn' omentielvo
w
wipo

Post by wipo »

It works great :) thx a lot.
Locked