mIRC Home    About    Download    Register    News    Help

Print Thread
#190208 17/11/07 08:14 PM
W
weedorcollege
weedorcollege
W
I'm creating a dialog for easy advertisement set up for the IRC network for a game I play. It'll have an option to input the text you want to advertise (with bold and underline able to be used), as well as a check box of all the channels meant to advertise in on the network (only three right now).

So far, I have this:
Code:
dialog SWC-AD {
  title "Combine Trade Advertisement"
  size -1 -1 300 200
  box "SWC-AD Setup", 12, 5 5 290 190
  button "Ok", 1, 95 160 50 25, ok
  button "Cancel", 2, 155 160 50 25, cancel
  text "Your advertisement:", 3, 10 20 280 50
  edit "Input advertisement here..", 4, 10 40 280 18
  text "Advertise in:", 5, 15 60 62 15
  check "#SWC-Trade", 6, 20 80 102 15
  check "#TheTraders", 7, 20 100 132 15
  check "#Stock_Exchange", 8, 20 120 120 15
  text "© Talon Xor, 2007" 9, 107 135 100 15
}


Now, that is pretty much exactly what I want, except for a few added things I will put in later. Such as more space to see a preview of the advertisement they put in, as well as a preview button, and maybe some other added text for other things. Anyhow..

What I'm wondering is how do I make it so if people upload the script, all they have to type it /swcad-su instead of /dialog -m SWC-AD SWC-AD to open the dialog?

Also, where can I find a good tutorial on how to add commands to all those things?

#190216 18/11/07 12:04 AM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
create a alias for it?
Code:
/swcad-su {
if (!$dialog(SWC-AD)){ dialog -m SWC-AD SWC-AD }
else if ($dialog(SWC-AD)){ echo -a Dialog already created, check if its minimized. }
}

Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
Or more simple :

Code:
alias swcad-su dialog $iif($dialog(SWC-AD),-v,-m) SWC-AD SWC-AD


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
#190229 18/11/07 04:25 AM
W
weedorcollege
weedorcollege
W
Well, this'll be the first thing I've ever coded. I'm still learning.

O
ots654685
ots654685
O
Originally Posted By: Wims
Or more simple :

Code:
alias swcad-su dialog $iif($dialog(SWC-AD),-v,-m) SWC-AD SWC-AD
What is different about this code and sparta's code?

I'm playing with dialog's as well that's why i ask.

#191354 07/12/07 01:03 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
my code is a bit longer then the code he wrote, thats about it wink

;------- Edit

I guess my code are a bit "old", and the other example here have the "new" style.

Last edited by sparta; 07/12/07 06:40 PM.
O
ots654685
ots654685
O
Originally Posted By: sparta
my code is a bit longer then the code he wrote, thats about it wink
Mmm only your code works except for that already running message, that doesn't seem to work.
Wims code doesn't do anything at all.

#191363 07/12/07 05:37 PM
Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
I've tested my code and it works perfectly, if the dialog isn't open, then open it,else just make it the active window (and sparta's code should works too)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard