mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Hi all, looking for some help on this problem.

Basicly i have an on text trigger which pops up a dialog
when a certain word (and soon to be action) is said or done
in a channel.

Ok, the dialog pops up when the word away is said, what i want
is a way to get a persons nick in an edit box.
For example my friend Nick1 says he is going away to eat lunch,
and sets his away status

My script then pops up the dialog saying

---------------------------------|
|[ Nick1 ]|
|is away from computer|
----------------------------------|

Code:
on 1:text:*away*:#:dialog -m awaynot1 awaynot1
on 1:text:*sleep*:#:dialog -m awaynot2 awaynot2
[color:green];more to come[/color] 

dialog awaynot1 {
  title ""
  size -1 -1 106 17
  option dbu
  icon 1, 0 0 16 16,  mirc.ico, 0
  text "is away from computer", 2, 16 10 90 8, center
  edit "", 3, 16 0 90 10, read center
}

dialog awaynot2 {
  title ""
  size -1 -1 106 17
  option dbu
  icon 1, 0 0 16 16, mirc.ico, 0
  text "user is sleeping", 2, 16 10 90 8, center
  edit "", 3, 16 0 90 10, read center  
}

on *:dialog:awaynot1:init:0:{
  did -a $dname 3 [color:red]$1[/color]
}


I checked the code for the did command from both the help file
and another script i have that outputs my ip address and if i
change $1 to $me or $ip then test the script, i gets either my nick
or my ip address in the edit box but not the nick that triggered the
event IF i change it back to $1, i have tried $2 and $$1 all to no avail.

Please can somebody help with this, as im really not sure what the command
prefix is ?

If you dont know i`v had trouble with the did command in the past, but i
like it because i find it a useful feature

Thanks
ShadowDemon

mIRC V6.03


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
edited:

on 1:text:*away*:#: {
dialog -m awaynot1 awaynot1
did -a awaynot 1 3 $nick
}
on 1:text:*sleep*:#: {
dialog -m awaynot2 awaynot2
did -a awaynot2 3 $nick
}
awaynot1 {
title "" size -1 -1 106 17
option dbu
icon 1, 0 0 16 16, mirc.ico, 0
text "is away from computer", 2, 16 10 90 8, center
edit "", 3, 16 0 90 10, read center
}
dialog awaynot2 {
title "" size -1 -1 106 17
option dbu
icon 1, 0 0 16 16, mirc.ico, 0
text "user is sleeping", 2, 16 10 90 8, center
edit "", 3, 16 0 90 10, read center
}

Last edited by pheonix; 03/07/03 01:29 PM.

new username: tidy_trax
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Umm i dont think you undersatnd what i mean pheonix, let me explain more

I dont want it to show my away status in a dilaog, i want it to show another user saying it in a channel.

Another example would be

Nick1 slaps ShadowDemon with a very rotton trout

I would then get a dialog box on my screen informing me that Nick1 has slapped me and i can enforce the proper punishment.

or another would be

Nick2 tells everybody in the channel that he`s off to bed and says goodnight and closes down his mirc, i then get a dialog popup saying Nick2 has gone to bed

asfar as i`m aware those variable would be set on my computer, but why would i need variables to show somebodys nick in an edit box if they only gonna be in that channel once never to come back, then i would have to go round my ini file and remove reduntant %variables.

But thanks for sorta trying to help me

I`m gonna use on text and on action trigger events eventually

If i use $1 all i get is a blank edit box


If i use $ip, i gets my ip address in the edit box


What i do want is the person who said the on text trigger event, there must be someway of doing this ?

ShadowDemon

Last edited by shadowdemon; 03/07/03 01:32 PM.

Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: May 2003
Posts: 215
Fjord artisan
Offline
Fjord artisan
Joined: May 2003
Posts: 215
You might want to try something like this.

Code:
on *:TEXT:*:#: {
  if ($(away) iswm $1-) {
    dialog -am $+(awaynot1,.,$nick) <dialog name>
    did -a $+(awaynot1,.,$nick) <id> $nick
    showmirc -s
 }
}


I've used $+(awaynot1,.,$nick) as the dialog name incase you're away from the computer and the script is triggered more then once, it won't cause any /dialog in use errors. Unless of course the same person use the word 'away' more then once while you're afk.

Finally, /showmirc -s will set mIRC as the active window after the dialog is opened, so that if you're in the middle of typing something and the dialog pops up, it will return focus to the editbox.


- Jason
Joined: Dec 2002
Posts: 295
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 295
Thanks lammkott

Thats what i wanted laugh

I will try play with the code and edit it, but i`ll probably leave it pretty much alone now.
It does the job i set out to do.

ShadowDemon


Never argue with an idiot...they'll drag you down to their level and beat you up with experience
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
u may try an if to check if your dialog is already open. Something like

if ($dialog(away2)) /dialg -vie away2 away2
else /dialog -m away2 away2

that would kill any errors u may have when your not immediatly on mirc to close the dialog before another user says "sleep","away",etc


-KingTomato

Link Copied to Clipboard