mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Ok i started a new script that allows me to do an ON *:TEXT event

I have made the script no problems and tested it, however im now stuck
on defining variables for On or Off using a combo box

Code:
menu channel {
Is Running:dialog -m isrun isrun
}

dialog isrun {
  title "New Project"
  size -1 -1 115 76
  option dbu
  text "Utilites Running Config", 1, 3 3 110 8
  combo 2, 33 15 23 30, size drop
  text "UT Server", 3, 3 15 30 8
  combo 4, 33 25 23 30, size drop
  text "Roger Wilco", 5, 3 25 30 8
  combo 6, 33 35 23 30, size drop
  text "WinAmp", 7, 3 35 30 8
  combo 8, 33 45 23 30, size drop
  text "UT", 9, 3 45 30 8
  button "OK", 11, 73 11 40 18, ok cancel
  icon 12, 86 30 16 16, mirc.ico, 0
}
[color:green]
on *:dialog:isrun:init:0:{
  did -a isrun 2 On
  did -a isrun 2 Off
  did -a isrun 4 On
  did -a isrun 4 Off
  did -a isrun 6 On
  did -a isrun 6 Off
  did -a isrun 8 On
  did -a isrun 8 Off
 }
[/color]
ON *:TEXT:!isrun:#utca {
  if (%serveron == on) {
    msg $chan 9UT Game Server Running
  }
  else {
    msg $chan 4UT Game Server Not Running
  }
  if (%rogeron == on) {
    msg $chan 9Roger Wilko Running
  }
  else {
    msg $chan 4Roger Wilko Not Running
  } 
  if (%winampon == on) {
    msg $chan 9Winamp Running
  }
  else {
    msg $chan 4Winamp Not Running
  } 
  if (%uton == on) {
    msg $chan 9Unreal Tournament Running
  }
  else {
    msg $chan 4Unreal Tournament Not Running
  } 
 }


I made the variables %serveron, %rogeron, %winampon and %uton and placed them manually into
my bots remote.ini file in the section for variables, then manually altered the variable
by maybe placing a %serveroff, %serveron and such, then tested the script by using the !isrun command, this works, what i`m stuck on is actually using the combo box in the dialog to set the status of the variable to On, or Off, could someone tell me how i can do this, i`v read the help file and searcehd the internet (again)

(I hope this is clear to whoever is reading this, as my descriptions aint none to clever.)
If you need a pic, just ask


Also is there a way that i can load the dialog on my mirc (shadowdemon) and select the state of the variables BUT pass and save them to the bots ini file where the variables are kept, that way i dont have to keep switching mIRCs so i can enable and disable the running apps, and still be able to type !isrun and have the bot inform me on my mirc (shadowdemon) what apps are running ?

I did read a bit about the /writeini command, but i`m unsure about how it works

ShadowDemon
mIRC V6.03






S
Sabby
Sabby
S
You should do this:

just make the-
UT Server (id = 1)
Roger Wilco (id = 2)
WinAmp (id = 3)
UT (id = 4)

checkboxes, and use this if statement for On and off

Code:
; If checkbox is clicked and you unclick it, set the variable off
on *:dialog:isrun:sclick:*:{
  if ($did == 1) set %serveron $iif($did(1).state,off,on)
  if ($did == 2) set %rogeron $iif($did(2).state,off,on)
  if ($did == 3) set %winampon $iif($did(3).state,off,on)
  if ($did == 4) set %uton $iif($did(4).state,off,on)
}


that should work, havent tested it

Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Hmm a problem, i did what you said, and used check boxes and got rid of the combo, used your id numbers and stuff, ran the dilaog setup for the code on my bot, and clicked the boxes i wanted to enable for On, yes it sets teh variable, but when i type !isrun, the bot tells me on my screen that they nothing is running, also it keeps forgetting which box is ticked, so each time i go back to the dialog settings again, i have to keep clicking in the check box again.



Thanks for your help
ShadowDemon

R
RAIN
RAIN
R
To shadowDemon to set variable by clicking on combo box you need to use sclick event in your dialog
example
on *:dialog:isrun:sclick:*: {
if ($did == 2) && ($did(2).seltext == on) { set %yourvariablehere on }
elseif ($did == 2) && ($did(2).seltext == off) { set %yorvariablehere off }
}
and so on for all id`s you have

Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
hmm, did you mean like this ?

Code:
on *:dialog:isrun:sclick:*: {
if ($did == 1) && ($did(1).seltext == on) { set %serveron on }
elseif ($did == 1) && ($did(1).seltext == off) { set %serveron off }
}

on *:dialog:isrun:sclick:*: {
if ($did == 2) && ($did(2).seltext == on) { set %rogeron on }
elseif ($did == 2) && ($did(2).seltext == off) { set %rogeron off }
}

on *:dialog:isrun:sclick:*: {
if ($did == 3) && ($did(3).seltext == on) { set %winampon on }
elseif ($did == 3) && ($did(3).seltext == off) { set %winampon off }
}

on *:dialog:isrun:sclick:*: {
if ($did == 4) && ($did(4).seltext == on) { set %uton on }
elseif ($did == 4) && ($did(4).seltext == off) { set %uton off }
}

on *:dialog:isrun:sclick:*: {
if ($did == 5) && ($did(5).seltext == on) { set %webcamon on }
elseif ($did == 5) && ($did(5).seltext == off) { set %webcamon off }
}

(BTW, i did put spces between the } and on, but this code has bunched it up)

Because all its doing is creating the first variable for %serveron on and nothing else, thanks for trying

ShadowDemon

Joined: Dec 2002
Posts: 292
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Dec 2002
Posts: 292
Hey, i was messing around with the code, and changing number around, when i thought about the

on *:dialog:isrun:sclick:*: { event and replaced the * with a number corrisponding with the number i wanted such as

on *:dialog:isrun:sclick:1: {
on *:dialog:isrun:sclick:2: {

and so on, and it created and changed the variables for me, hehe now i know it works i can go to bed and get some sleep laugh

Thanks to all those who helped

ShadowDemon


Link Copied to Clipboard