|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
I want a script to when a user type, for example, "!en:Japan" in the channel, the bot says "http://en.wikipedia.org/wiki/Japan".
aflm
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
on *:text:*:#:{
if (!?*:?* iswm $1) msg $chan $+(http://www.,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
Thank you! I did not work... remember that the url does not have "www". ($1,1,58),2),.WIKIPEDIA.ORG/WIKI/,$GETTOK($1,2,58)) Unknown command
Last edited by aflm; 11/02/06 10:44 PM.
aflm
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on *:text:*:#:{
if (!?*:?* iswm $1) msg $chan $+(http://,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
What is wrong? Is it my fault? I just copy-paste the code and save the script. 1,1,58),2),.WIKIPEDIA.ORG/WIKI/,$GETTOK($1,2,58)) Unknown command
aflm
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
That's weird! Hmm.. are you sure you pasted it in correctly? Make sure it looks exactly like it does on this page.
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
I was using a wrong command ("!en article" instead of "!en:article"), but it does not work yet. The error given when I use the !en:article command is Invalid format: $+ (line 3, script1.mrc) .
aflm
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
Then again you must've pasted the wrong script. Invalid format errors come from not having enough ( or ) and there's an exact match.
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
:'( Actually, it was my fault. My browser was broking the code into two lines. Now I copied all the command in a single line, and it works! Thank you so much.... I'm not a newbee, but sometimes I forget the simpler things!
aflm
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
Everybody loves the script... now, I'll ask you to improve it to a new level... in Wikipedia, the user pages, categories and other pages have the sintax "http://en.wikipedia.org/wiki/Category:IRC". I ask you try to make the script support pages like category:IRC.
aflm
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
This only needs one byte adding to it :tongue: on *:text:*:#:{
if (!?*:?* iswm $1) msg $chan $+(http://www.,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2[color:red]-[/color],58))
}
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
on *:text:*:#:{ if (!?*:?* iswm $1) msg $chan $+(http://,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2 -,58)) } Use: !en:Category:IRC Shows: http://en.wikipedia.org/wiki/Category:IRC-genius_at_work
|
|
|
|
Joined: Feb 2006
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 7 |
Terrific!
aflm
|
|
|
|
|