Jump to content

Return To


CharmedOne

Recommended Posts

Ok like the old vincula you know how you click on like a nick on the access list it shows the info in a different window that looks disabled ? Thats what I am trying to do but it is not something I am familure with, can ya help fix my jokes editor ty, i just wanted to click on a joke & it read back on bottom window which looks disabled.

 

NOTE: It does kinda return but it dosent return exactly what I select it seems to be adding everything in it.

 

 

Dialog:

 

dialog cbjokes {
  title "Jokes System Editor"
  size -1 -1 216 185
  option dbu
  icon photos/icon.ico, 0
  box "", 22, 5 107 204 22
  button "OK", 23, 73 135 70 10, flat ok
  button "Close", 24, 144 135 70 10, flat cancel
  box "Jokes Editor", 27, 2 0 212 133
  edit "", 28, 5 8 205 11, autohs
  button "Add Joke", 29, 8 115 65 10, flat
  button "Delete Joke", 30, 77 115 65 10, flat
  button "Delete All", 31, 2 135 70 10, flat
  list 33, 5 19 205 94
  button "Msg Channel", 1, 146 115 60 10, flat
  edit "", 2, 1 147 213 36, read multi return autovs
}

 

 

 

 

 

 

Code:

 

 

on *:dialog:cbjokes:init:0:{ 
  /set %u 0
  :loop
  /inc %u 1
  if ($read -l [ $+ [ %u ] ] gamestuff\Stupid.txt == $null) { goto endl }
  else { /did -a cbjokes 33 $read -l $+ %u gamestuff\Stupid.txt | goto loop }
  :endl
}
on *:dialog:cbjokes:sclick:*:{
  if ($did == 1) {
    if ($did($did).sel == $null) halt
    if ($gettok($did(33).seltext,1,32) != 0) { did -a $dname 2 }
    /msg $active $did(33).seltext
  }
  if ($did == 29) { 
    /write gamestuff\Stupid.txt $did(28).text
    /set %jokes. $+ $did(28).text 1
    /did -a cbjokes 33 $did(28).text
    did -r cbjokes 28  
  }
  if ($did == 30) {
    if ($did($dname,33,$did(33).sel).text == $null) { echo -a %c2 $+ ( $+ Gamearea $+ ) %c1 $+ You must select a jokes to delete first! | halt }
    /write -ds [ $+ [ $did($dname,33,$did(33).sel).text ] ] gamestuff\Stupid.txt
    /unset %jokes. [ $+ [ $did($dname,33,$did(33).sel).text ] ]
    /did -d cbjokes 33 $did(33).sel
  }
  if ($did == 31) { 
    /dialog -x cbjokes cbjokes
    /cbaus2
  }
  if ($did == 33) {
    if ($gettok($did(33).seltext,1,32) != 0) { did -a $dname 2 $read $mircdir\gamestuff\Stupid.txt $+ $did(33).seltext }
    if ($gettok($did(33).seltext,1,32) == 0) { did -a $dname 2 $read $mircdir\gamestuff\Stupid.txt $+ $did(33).seltext }
  }
}

Link to comment
Share on other sites

well one thing is you need to did -ra not just -a

-a will just keep adding to what's already in the box -r clears it so use -ra

 

all i did was add the r in three places for the did to the edit 2

 

on *:dialog:cbjokes:init:0:{
  /set %u 0
  :loop
  /inc %u 1
  if ($read -l [ $+ [ %u ] ] gamestuff\Stupid.txt == $null) { goto endl }
  else { /did -a cbjokes 33 $read -l $+ %u gamestuff\Stupid.txt | goto loop }
  :endl
}
on *:dialog:cbjokes:sclick:*:{
  if ($did == 1) {
    if ($did($did).sel == $null) halt
    if ($gettok($did(33).seltext,1,32) != 0) { did -ra $dname 2 }
    /msg $active $did(33).seltext
  }
  if ($did == 29) {
    /write gamestuff\Stupid.txt $did(28).text
    /set %jokes. $+ $did(28).text 1
    /did -a cbjokes 33 $did(28).text
    did -r cbjokes 28  
  }
  if ($did == 30) {
    if ($did($dname,33,$did(33).sel).text == $null) { echo -a %c2 $+ ( $+ Gamearea $+ ) %c1 $+ You must select a jokes to delete first! | halt }
    /write -ds [ $+ [ $did($dname,33,$did(33).sel).text ] ] gamestuff\Stupid.txt
    /unset %jokes. [ $+ [ $did($dname,33,$did(33).sel).text ] ]
    /did -d cbjokes 33 $did(33).sel
  }
  if ($did == 31) {
    /dialog -x cbjokes cbjokes
    /cbaus2
  }
  if ($did == 33) {
    if ($gettok($did(33).seltext,1,32) != 0) { did -ra $dname 2 $read $mircdir\gamestuff\Stupid.txt $+ $did(33).seltext }
    if ($gettok($did(33).seltext,1,32) == 0) { did -ra $dname 2 $read $mircdir\gamestuff\Stupid.txt $+ $did(33).seltext }
  }
}

Link to comment
Share on other sites

you are doing a extra did and read isn't needed in the sclick 33

 

  if ($did == 33) {
    if ($did(33).seltext) { did -ra $dname 2 $did(33).seltext }
  }

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...