mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
Alright, I'm trying to make a dialog change the value of some text boxes to the variable when you select it on the list, so far I have
Code:
on *:dialog:cmd4options:sclick:22: {
  var %v $readini(cmd4vars.ini,commands,$did($dname,22).seltext)
  var %a $mid(%v, $findtok(%v,;,1,$asc(;)), $len(%v))
  var %l $mid(%v, 1, $findtok(%v,;,1,$asc(;)))
  did -o $dname 24 1 %l
  did -c $dname 25 %a
}

The ini file
Code:
[commands]
say=2;4

Which means, required level is 2 and in the combo box select 4 (Do nothing)
The dialog
Code:
  ;Tab 4 (Command Control)
  list 22, 4 20 50 172, tab 17
  text "Required Level:", 23, 56 24 40 9, tab 17
  edit "", 24, 56 32 15 9, tab 17 autohs
  combo 25, 56 45 50 9, tab 17 drop

And the list code
Code:
;Combo Boxes
  did -a $dname 22 say
  did -a $dname 22 whois
  did -a $dname 22 kick
  did -a $dname 22 ban
  did -a $dname 22 newuser
  did -a $dname 22 remuser
  did -a $dname 22 whois
  did -a $dname 22 getip
  did -a $dname 22 log
  did -a $dname 22 part
  did -a $dname 22 join
  did -a $dname 22 quit
  did -a $dname 22 call

  did -a $dname 25 Msg Channel
  did -a $dname 25 Msg Nick
  did -a $dname 25 Say
  did -a $dname 25 Do nothing

That doesn't need editing wink
Thanks grin

Edit: woops forgot to post the question
It doesn't load the variables, just leaves everything blank

Last edited by benjy355; 20/11/05 03:43 PM.

Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Nov 2005
Posts: 3
R
Self-satisified door
Offline
Self-satisified door
R
Joined: Nov 2005
Posts: 3
Are the variables actually being set using var?

try

Code:
 on *:dialog:cmd4options:sclick:22: {

  set %v $readini(cmd4vars.ini,commands,$did($dname,22).seltext)

  set %a $mid(%v, $findtok(%v,;,1,$asc(;)), $len(%v))

  set %l $mid(%v, 1, $findtok(%v,;,1,$asc(;)))

  did -o $dname 24 1 %l

  did -c $dname 25 %a

} 

Last edited by rich_; 20/11/05 10:54 PM.

irc.austchat.net
- Try it! its free.
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try this:

Code:
on *:dialog:cmd4options:sclick:22: {
  var %v = $readini(cmd4vars.ini,commands,$did($dname,22).seltext)
  did -o $dname 24 1 $gettok(%v,1,$asc(;))
  did -c $dname 25 $gettok(%v,2,$asc(;))
}



And, in case you didn't know, you can use the /didtok command to load a bunch of items into a list/combo box at once. Just make the items into a token list list below. The list is separated by commas ($chr(44)).

Code:
didtok $dname 22 44 say,whois,kick,ban,newuser,remuser,whois,getip,log,part,join,quit,call
didtok $dname 25 44 Msg Channel,Msg Nick,Say,Do Nothing


-genius_at_work

Last edited by genius_at_work; 20/11/05 11:14 PM.
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
yay it worked thanks! grin


Chat NSN
My Server: sleepystickman.ircxpro.com

Link Copied to Clipboard