mIRC Home    About    Download    Register    News    Help

Print Thread
Advertisement Dialog #190208 17/11/07 08:14 PM
Joined: Nov 2007
Posts: 50
weedorcollege Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2007
Posts: 50
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?

Re: Advertisement Dialog [Re: weedorcollege] #190216 18/11/07 12:04 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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. }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Advertisement Dialog [Re: sparta] #190222 18/11/07 02:16 AM
Joined: Jul 2006
Posts: 3,833
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,833
Or more simple :

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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Advertisement Dialog [Re: weedorcollege] #190229 18/11/07 04:25 AM
Joined: Nov 2007
Posts: 50
weedorcollege Offline OP
Babel fish
OP Offline
Babel fish
Joined: Nov 2007
Posts: 50
Well, this'll be the first thing I've ever coded. I'm still learning.

Re: Advertisement Dialog [Re: Wims] #191353 07/12/07 11:15 AM
Joined: Feb 2006
Posts: 97
O
ots654685 Offline
Babel fish
Offline
Babel fish
O
Joined: Feb 2006
Posts: 97
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.

Re: Advertisement Dialog [Re: ots654685] #191354 07/12/07 01:03 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Advertisement Dialog [Re: sparta] #191360 07/12/07 03:39 PM
Joined: Feb 2006
Posts: 97
O
ots654685 Offline
Babel fish
Offline
Babel fish
O
Joined: Feb 2006
Posts: 97
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.

Re: Advertisement Dialog [Re: ots654685] #191363 07/12/07 05:37 PM
Joined: Jul 2006
Posts: 3,833
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,833
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)


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net