mIRC Home    About    Download    Register    News    Help

Print Thread
#171115 19/02/07 05:03 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
How can I make a word into a link?

I have a window in witch names/words from a .txt are read.
When I click on that name/word i want it to perform a certain command (/run something).

If I double click a nick in a channel it opens a query.
How can I make a specific word behave like #channel or a nick on a chan when you double click it?

yetti #171121 19/02/07 07:03 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
this code:
Code:
 var %t = $lines(read.txt), %ti = 1 | while (%ti <= %t) {
        echo @info $gettok($read(read.txt,%ti),2-,32)
        inc %ti
      } 

Echos the content of the file read.txt to a custom window, starting with the second word.
The Content of the file has this structure:
Quote:
IP - nick :: <some other text..>


The output looks something like this:
Quote:

- nick1 :: <some other text..>
- nick2 :: <some other text..>
- nick3 :: <some other text..>
etc


how can I make the output nick to be a link to this command:
Quote:

/run $findfile($logdir,$replace(<nick>,|,_) $+ .log,1)


so that when I double click on that nick in the window to open the log file?

Thanks

p.s: I know i have to use HOTLINK, $hotline, but i have no ideea how to do it...

EDIT:

Code:
on ^1:HOTLINK:anick:@info:{
  if ($1 == anick ) return 
  halt
}
on 1:HOTLINK:*anick*:@info { /run $findfile($logdir,$replace(anick,|,_) $+ .log,1) }

this will open the log file named anick.log...
how do I make it work for evey nick outputed by the read of the file?

Last edited by yetti; 19/02/07 07:15 PM.
yetti #171128 19/02/07 09:08 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Assuming your text looks exactly like your example:

Quote:

- nick1 :: <some other text..>
- nick2 :: <some other text..>
- nick3 :: <some other text..>


Then, you can use this to make the nicks clickable:

Code:
on ^1:HOTLINK:*:*:{
  if ($gettok($hotline,2,32) == $1) { return }
  halt
}

on 1:HOTLINK:*:*:{
  echo -a $1 was clicked
}


Of course, you mentioned IP as being before the - and your example doesn't show that. Does your output look the way you showed it, or does it have an IP, or does it vary?


Invision Support
#Invision on irc.irchighway.net
yetti #171129 19/02/07 09:14 PM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
Originally Posted By: yetti
this code:
Code:
 var %t = $lines(read.txt), %ti = 1 | while (%ti <= %t) {
        echo @info $gettok($read(read.txt,%ti),2-,32)
        inc %ti
      } 

Echos the content of the file read.txt to a custom window, starting with the second word.
The Content of the file has this structure:
Quote:
IP - nick :: <some other text..>



yes.. in the file I have: ip - nick :: bla bla

the read code (see first code) outputs starting with $2 ( the "-" before the nick)

so in the file i have: ip - nick .. but the output is always: - nick ..

I need to integrate this link thingy in the output code.. so that it will output all the nicks in the file ($3) with a link to the run command.

Last edited by yetti; 19/02/07 09:16 PM.
yetti #171136 19/02/07 11:57 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Then all you need to do is take what I gave you, change the location that you're using it from * to @custom (change @custom to the name of your custom window) and then change the echo line to:

run $findfile($logdir,$replace($1,|,_) $+ .log,1)


Just have the list generated like you normally would.


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171158 20/02/07 06:03 AM
Joined: Dec 2006
Posts: 31
Y
yetti Offline OP
Ameglian cow
OP Offline
Ameglian cow
Y
Joined: Dec 2006
Posts: 31
it works.
thanks a lot Riamus2.


Link Copied to Clipboard