egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Return url from a trigger + Text

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
johnpursglove
Voice


Joined: 06 Sep 2008
Posts: 3

PostPosted: Sat Sep 06, 2008 9:19 pm    Post subject: Return url from a trigger + Text Reply with quote

Hello first post. Just got started in the world of Eggdrop.

Trying to do a simple script that spits out a url from www.ipdb.org (pinball machine database) after a trigger is entered on the channelipdb followed by the name of a game. This script was originally a wiki script I tried to modify for my own needs. Ie:

!IPDB pinbot should return in the channel for all to see.

http://$::www.ipdb.org/search.pl?searchtype=quick&any=pinbot

Any help would be appreciated.
The code is below....

Code:

#========================================================================
# ** IPDB Quick Link
#========================================================================
# * Description:
#
#    * Allows IRC users to link to IPDB quickly through the bot.
#    * The default format is:
#       !ipdb game name
#
#------------------------------------------------------------------------
# * Features:
#
#========================================================================

# Calls the script when people say !ipdb at the start of the line.
# Changes this to whatever you want to make the script call on other
#  keywords.
bind pub - "!ipdb" spidey:ipdb_link

# Two letter language of the wiki you want to link to.

proc spidey:ipdb_link { nick hand chan text } {

      
   # Print link
   putserv "PRIVMSG $chan http://$::www.ipdb.org/search.pl?searchtype=quick&any=$text (Requested by \002$nick\002)"
}

# Log the script as successfully loaded.
putlog "IPDB_log: Loaded"


Last edited by johnpursglove on Sat Sep 06, 2008 10:22 pm; edited 1 time in total
Back to top
View user's profile Send private message
johnpursglove
Voice


Joined: 06 Sep 2008
Posts: 3

PostPosted: Sat Sep 06, 2008 10:22 pm    Post subject: Almost SOLVED - RE- Return url from a trigger + Text Reply with quote

Well I solved my own problem for the most part. Found some stuff here in this forum. Read a few parts and came up with a good answer. Well almost. How can I parse a space in the text.

IE !ipdb Black Knight
returns
http://www.ipdb.org/search.pl?searchtype=quick&any=Black

thanks in advance for any help.
John

Code:

##################################################################
#           Internet Pinball Database Game Look up Script
#     For fast searching of  Internet Pinball Database
#     through a bot.
#     
#     
#      Please Feel free to improve this script in any way
#      and use it in your bots!!!
##################################################################



bind pub - "!ipdb" pinbot:ipdbproc

proc pinbot:ipdbproc {name uhost hand chan text} {
        puthelp "PRIVMSG $chan http://www.ipdb.org/search.pl?searchtype=quick&any=$text"
   }
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sun Sep 07, 2008 1:31 pm    Post subject: Reply with quote

Code:
puthelp "PRIVMSG $chan http://www.ipdb.org/search.pl?searchtype=quick&any=[string map {" " "%20" "_" "%20"} $text]"

[string map] is your friend in this case. Any (space) or (underscore) within $text will be exchanged with %20's.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
johnpursglove
Voice


Joined: 06 Sep 2008
Posts: 3

PostPosted: Sun Sep 07, 2008 9:38 pm    Post subject: Thanks Problem solved. Reply with quote

Thanks! Worked like a charm.

Quote:


[string map] is your friend in this case. Any (space) or (underscore) within $text will be exchanged with %20's.

[/quote]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber