mIRC Home    About    Download    Register    News    Help

Topic Options
#141665 - 11/02/06 09:42 PM Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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

Top
#141666 - 11/02/06 10:29 PM Re: Wikipedia
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
Code:
on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://www.,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}

Top
#141667 - 11/02/06 10:35 PM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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 


Edited by aflm (11/02/06 10:44 PM)
_________________________
aflm

Top
#141668 - 11/02/06 11:20 PM Re: Wikipedia
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
Code:
 on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
 

Top
#141669 - 11/02/06 11:34 PM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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

Top
#141670 - 11/02/06 11:43 PM Re: Wikipedia
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
That's weird! shocked

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

Top
#141671 - 11/02/06 11:54 PM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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

Top
#141672 - 11/02/06 11:58 PM Re: Wikipedia
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
Then again you must've pasted the wrong script. Invalid format errors come from not having enough ( or ) and there's an exact match.

Top
#141673 - 12/02/06 12:30 AM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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

Top
#141674 - 12/02/06 01:45 AM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
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

Top
#141675 - 12/02/06 01:58 AM Re: Wikipedia
hixxy Offline
Hoopy frood

Registered: 06/09/05
Posts: 2876
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))
}

Top
#141676 - 12/02/06 02:00 AM Re: Wikipedia
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
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

Top
#141677 - 12/02/06 01:32 PM Re: Wikipedia
aflm Offline
Nutrimatic drinks dispenser

Registered: 11/02/06
Posts: 7
Terrific! grin
_________________________
aflm

Top