mIRC Home    About    Download    Register    News    Help

Print Thread
#108228 18/01/05 02:13 AM
Joined: Jan 2005
Posts: 1
L
linlin Offline OP
Mostly harmless
OP Offline
Mostly harmless
L
Joined: Jan 2005
Posts: 1
I need to be able to right click on an IP address anywhere in m/irc and have an option to run a command with the IP in the command.

For instance. If I right click on 124.242.232.134 and select the option it needs to do /run c:/program files/radmin viewer 3.0/radmin.exe /connect:124.242.232.134 /telnet

I need it to change the /run command depending on which IP is being right clicked on.

Thanks alot to anybody that can help.

#108229 18/01/05 04:56 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
i dont beleieve you can just create a rigth click area for something, you would need to hotlink the area, and thatmeans lots of work.

What about this, you copy the the IP to the clipboard (ie highlight with mouse then release mouse button), then right click and you get an option in the right click menu "IP ACTION FOR xxx.xxx.xxx.xxx" then a submenu of items you can do for that nick.

Code:
menu status,channel,query,nicklist {
  $iif(($longip($longip($cb)) == $cb),IP ACTION FOR $cb)
  .$iif(($cb == 124.242.232.134),RaDmIn ) : /run c:/program files/radmin viewer 3.0/radmin.exe /connect:124.242.232.134 /telnet
  .$iif(($cb == 124.242.232.134),BobsViewer) : /run bobsviewer.exe 124.242.232.134
  .$iif(($cb == 1.2.3.4),SOME OPTION NAME) : /run somethingeelse.exe $cb
  .$iif(($cb == 101.101.101.101),Some Option Name) : /run blah.exe
}


that or no subment and use
Code:
menu status,channel,query,nicklist {
  $iif(($cb == 124.242.232.134),RaDmIn ) : /run c:/program files/radmin viewer 3.0/radmin.exe /connect:124.242.232.134 /telnet
  $iif(($cb == 124.242.232.134),BobsViewer) : /run bobsviewer.exe 124.242.232.134
  $iif(($cb == 1.2.3.4),SOME OPTION NAME) : /run somethingeelse.exe $cb
  $iif(($cb == 101.101.101.101),Some Option Name) : /run blah.exe
}

#108230 19/01/05 03:16 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Very basic, no right-click option, mIRC only allows us double-clicks for hotlinks. It's a pretty poor regexp pattern to match IPs too smile
Code:
on $^*:hotlink:/\b(\d+\.\d+)\.(?1)\b/S:*:if !$longip($1) { halt }
on $*:hotlink:/\b(\d+\.\d+)\.(?1)\b/S:*:{
  if $1 == 124.242.232.134 {
    echo -a /run c:/program files/radmin viewer 3.0/radmin.exe /connect:124.242.232.134 /telnet
  }
  elseif $1 == 127.0.0.1 { echo 12 -a $1 is localhost f00! }
  else echo You get the idea, $1 is the IP - $hotline is the whole line.
}

#108231 20/01/05 12:40 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
he could change the ^ event to

[/code]
on $^*:hotlink:/\b(\d+\.\d+)\.(?1)\b/S:*:{
if !$longip($1) { unset %hotlink.ip | halt }
set %hotlink.ip $1
}
;
; and then add em else some right click menu options as well
;
menu status,channel,query,nicklist {
$iif((%hotlink.ip == 124.242.232.134),RaDmIn ) : /run c:/program files/radmin viewer 3.0/radmin.exe /connect:124.242.232.134 /telnet
$iif((%hotlink.ip == 124.242.232.134),BobsViewer) : /run bobsviewer.exe 124.242.232.134
}
[/code]

Its a bit of a fudge tho, cause you cant actually right click on the hotlink, you have to move the mouse away but a glide over and then right click isnt too bad

PS: very nice hotlink mather, i was talking out a hole in the side of my head, when i said there was alot of work, i remeber when i did one, but it was lots of work becuase i was trapping the TEXT stripping it, seeing if what i wanted hotlinked was in it, working out how to get up to and after the hotlinked part left color, while making the hotlink event able to see the part i wanted was a hotlink without it showing up as any different, used $chr(160) to replace spaces and started and ended the hotlink text with CTRL-B,CTRL-R,CTRL-B,CTRL-R, The hardest part i found was workling out what the text i wanted hotlinked was in the line, when all the color codes were still in the line.


Link Copied to Clipboard