mIRC Homepage

Advertisement Dialog

Posted By: weedorcollege

Advertisement Dialog - 17/11/07 08:14 PM

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?
Posted By: sparta

Re: Advertisement Dialog - 18/11/07 12:04 AM

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. }
}
Posted By: Wims

Re: Advertisement Dialog - 18/11/07 02:16 AM

Or more simple :

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

Re: Advertisement Dialog - 18/11/07 04:25 AM

Well, this'll be the first thing I've ever coded. I'm still learning.
Posted By: ots654685

Re: Advertisement Dialog - 07/12/07 11:15 AM

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.
Posted By: sparta

Re: Advertisement Dialog - 07/12/07 01:03 PM

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.
Posted By: ots654685

Re: Advertisement Dialog - 07/12/07 03:39 PM

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.
Posted By: Wims

Re: Advertisement Dialog - 07/12/07 05:37 PM

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)
© 2022 mIRC Discussion Forums