mIRC Home    About    Download    Register    News    Help

Print Thread
Wikipedia #141665 11/02/06 09:42 PM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
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
Re: Wikipedia #141666 11/02/06 10:29 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Code:
on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://www.,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}

Re: Wikipedia #141667 11/02/06 10:35 PM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2006
Posts: 7
Thank you! grin

frown I did not work... remember that the url does not have "www".

Code:
 ($1,1,58),2),.WIKIPEDIA.ORG/WIKI/,$GETTOK($1,2,58)) Unknown command 

Last edited by aflm; 11/02/06 10:44 PM.

aflm
Re: Wikipedia #141668 11/02/06 11:20 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Code:
 on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
 

Re: Wikipedia #141669 11/02/06 11:34 PM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2006
Posts: 7
What is wrong? Is it my fault? I just copy-paste the code and save the script.

Code:
1,1,58),2),.WIKIPEDIA.ORG/WIKI/,$GETTOK($1,2,58)) Unknown command 


aflm
Re: Wikipedia #141670 11/02/06 11:43 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
That's weird! shocked

Hmm.. are you sure you pasted it in correctly? Make sure it looks exactly like it does on this page.

Re: Wikipedia #141671 11/02/06 11:54 PM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
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
Quote:
Invalid format: $+ (line 3, script1.mrc)
.


aflm
Re: Wikipedia #141672 11/02/06 11:58 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
Then again you must've pasted the wrong script. Invalid format errors come from not having enough ( or ) and there's an exact match.

Re: Wikipedia #141673 12/02/06 12:30 AM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
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! laugh


aflm
Re: Wikipedia #141674 12/02/06 01:45 AM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
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
Re: Wikipedia #141675 12/02/06 01:58 AM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,876
This only needs one byte adding to it :tongue:

Code:
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))
}

Re: Wikipedia #141676 12/02/06 02:00 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
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

Re: Wikipedia #141677 12/02/06 01:32 PM
Joined: Feb 2006
Posts: 7
A
aflm Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Feb 2006
Posts: 7
Terrific! grin


aflm