mIRC Homepage
Posted By: Bully Help with something - 10/10/14 10:00 AM
Hey,
I would like to make a basic script that will do the next:
Once you do !search Firstname_Lastname it will return
www:example.com/usersearch&Firstname_Lastname/blabla=b

Basically, a link that include the Firstname_Lastname I've placed. So if for example I did: !search Mark_Tiven it will return:
www.example.com/usersearch&Mark_Tiven/blabla=b.

(If you didn't understand what I've tried to exaplain I'll try to explain again..)

Thank you in advance everyone!
Posted By: Nillen Re: Help with something - 10/10/14 10:14 AM
Are you looking for a dynamic link that actually opens a search engine, enters your search and gives you the actual url or are you looking for something static in a message? Example of a static message:
Code:
on *:text:!search &:#: { 
var %search $2
msg # www.example.com/usersearch& $+ %search $+ /blabla=b
}
Posted By: Bully Re: Help with something - 10/10/14 10:43 AM
Thanks!! It works!
Another question wink How can I restrict a script to a specific channel? If for example there are two on the same server and I want that only on one of them the commands will be available.

Thank you very very much!
Posted By: JB_uk Re: Help with something - 10/10/14 10:53 AM
Simply restrict it by adding the channel name at the top.

From what Nillen said
Code:
on *:text:!search &:#CHANNELNAME: { 
var %search $2
msg # www.example.com/usersearch& $+ %search $+ /blabla=b
}
Posted By: Bully Re: Help with something - 10/10/14 11:04 AM
Thanks. Another stupid, but seems to be last, question. Other clients can use my script and do that command but for some reason I can't. (I can't use my own script). Is there something I'm missing? Thank you, once again.
Posted By: Nillen Re: Help with something - 10/10/14 11:08 AM
You can not trigger text events yourself. Text events are entirely remote based, primary use for bots. If you want to use it yourself while typing, you could either use
Code:
on 1:input:#:{ 
if ($1 == !search) && ($2) { 
var %search $2
msg # www.example.com/usersearch& $+ %search $+ /blabla=b
}
}
Or you could also make it into an alias etc.
Posted By: Bully Re: Help with something - 10/10/14 11:15 AM
Thank you very much, highly appreciated!

EDIT: Oy, now the !search doesn't work for me and I believe it doesn't work for anyone shocked
Posted By: Nillen Re: Help with something - 10/10/14 11:31 AM
Then you probably didn't include a bracket when you were copy-pasting or something. Try checking for brackets and if that doesn't give you an error message. Post your entire remote.ini file here and I'll check it for errors
Posted By: Bully Re: Help with something - 10/10/14 01:35 PM
nvm it works.
Now, if I want to make it even better. Is it easy to, instead of simply writing the link, open a link on your browser?
I mean, instead of writing (msg..) it will open it in your browser.

Thank you Nillen very much!
Posted By: hixxy Re: Help with something - 10/10/14 08:07 PM
You can't make it open in other people's browsers but you can your own.

Change 'msg #' in the on input event to 'url -n' smile
© mIRC Discussion Forums