mIRC Home    About    Download    Register    News    Help

Print Thread
#248493 10/10/14 10:00 AM
B
Bully
Bully
B
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!

#248495 10/10/14 10:14 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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
}

B
Bully
Bully
B
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!

#248498 10/10/14 10:53 AM
J
JB_uk
JB_uk
J
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
}

#248500 10/10/14 11:04 AM
B
Bully
Bully
B
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.

#248501 10/10/14 11:08 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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.

B
Bully
Bully
B
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

Last edited by Bully; 10/10/14 11:18 AM.
#248504 10/10/14 11:31 AM
Joined: Dec 2013
Posts: 771
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 771
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

B
Bully
Bully
B
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!

#248517 10/10/14 08:07 PM
Joined: Sep 2005
Posts: 2,630
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,630
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


Link Copied to Clipboard