mIRC Homepage
Posted By: aflm Wikipedia - 11/02/06 09:42 PM
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".
Posted By: hixxy Re: Wikipedia - 11/02/06 10:29 PM
Code:
on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://www.,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
Posted By: aflm Re: Wikipedia - 11/02/06 10:35 PM
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 
Posted By: RusselB Re: Wikipedia - 11/02/06 11:20 PM
Code:
 on *:text:*:#:{
  if (!?*:?* iswm $1) msg $chan $+(http://,$mid($gettok($1,1,58),2),.wikipedia.org/wiki/,$gettok($1,2,58))
}
 
Posted By: aflm Re: Wikipedia - 11/02/06 11:34 PM
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 
Posted By: hixxy Re: Wikipedia - 11/02/06 11:43 PM
That's weird! shocked

Hmm.. are you sure you pasted it in correctly? Make sure it looks exactly like it does on this page.
Posted By: aflm Re: Wikipedia - 11/02/06 11:54 PM
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)
.
Posted By: hixxy Re: Wikipedia - 11/02/06 11:58 PM
Then again you must've pasted the wrong script. Invalid format errors come from not having enough ( or ) and there's an exact match.
Posted By: aflm Re: Wikipedia - 12/02/06 12:30 AM
:'( 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
Posted By: aflm Re: Wikipedia - 12/02/06 01:45 AM
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.
Posted By: hixxy Re: Wikipedia - 12/02/06 01:58 AM
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))
}
Posted By: genius_at_work Re: Wikipedia - 12/02/06 02:00 AM
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
Posted By: aflm Re: Wikipedia - 12/02/06 01:32 PM
Terrific! grin
© mIRC Discussion Forums