Skip to content
MSN Addons

Dialog help

A TG007 community discussion started by Mr_S.

Discussion 9 posts
Page 1 of 1
Open
Topic #7245 · 9 published posts · 1,847 views

ello's.. Aint been here for a while.

 

need some help with Dialog that i finally started to be arsed to learn.

 

;Testing

menu channel {

hop :Dialog -m test test

}

dialog test {

title IRC Control

size -1 -1 88 192

option dbu

button "Hop", 2, 0 8 37 12, ok

text "Dialog Testing", 1, 16 0 65 8, center

button "Part", 3, 48 8 37 12, result ok

link http://g00ber.com, 4, 16 32 46 8

}

}

on *:Dialog:click:test:*:{

if ($did == 2) { hop $chan }

if ($did == 3) { part }

}

 

Nice, small and simple for a new start - but clicking on "hop" dont do nudda :(

Did i miss a part?

 

Many thanks

 

Don't see the point in making a dialog to hop lol but whatever floats ya boat x, try hop $comchan($me,1) i didn't really look at the code so thats a guess..

on *:Dialog:click:test:*:{
if ($did == 2) { hop $chan }
if ($did == 3) { part }
}

Is wrong .. should be:

on *:Dialog:sclick:test:*:{
if ($did == 2) { hop $chan }
if ($did == 3) { part }
}

Missed the sclick.

and u would use $active...

 

but i also agree with Gazza. it's pointless.

 

might aswell just use ..

alias F1 { hop # }
alias F2 { part # }

 

even thought that is still pointless.

just that on click event i needed towork so i didnt paste a whole dialog to only correct one error...

 

would have been a bigger pointless post to do the whole dialog to only correct wut i could see as one error :)

 

Thanks for the help! :D

Edited Aug 24, 2006 9:00 PM by Mr_S

For future reference, you cannot use $chan on a dialog as it refers to a channel event. Instead, you will need to use an alias such as $active (referring to the active window, which is not necessarily a channel window) or $comchan. However, neither of these are completely flawless if you are in multiple channels. Instead, I would recommend creating a temporary hash table or variable containing the channel name that you wish to use; storing the channel name will ensure that you refer to the correct channel that you were referring to.

 

You can argue that using mIRC is pointless as you can just as easily use a webchat service or a web browser that has built-in IRC compatibility so essentially, all mIRC addons are pointless. However, the experience of using a programming language as simple as mIRC's coding can aid future learning of a different programming language, such as C++. In this instance, mr_s now knows that he cannot use $chan in a dialog.

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.

actually if i remember there is a way you can use $chan

but you need to set the focus on the window or asosiate the dialog with it

 

something to do with having the chan widow as the parent

My code does NOT have bugs. It just develops random features.

I don't recall a method myself but if you find one, please let me know.

I don't get paid to know the answer, therefore I'm far more likely to give you a straight and honest answer.

You can do it that way if I'm not mistaken by using -a. You use it with -m when opening a dialog, as it sets the current window as the parent

dialog -ma id id

Something like that