mIRC Home    About    Download    Register    News    Help

Print Thread
Script not saving, no errors too. #135857 18/11/05 05:06 AM
Joined: Oct 2005
Posts: 54
B
benjy355 Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
Alrighty, I'm working for a dialog to save the channels into a list, the list loads fine, no loops that cause mirc to freeze, just when you try to add something, it NEVER saves, and no errors record.
On Dialog
Code:
on *:dialog:cmd4options:7:sclick: {
  if ($did(cmd4options,6).text) {
    var %i 1
    while ($readini(cmd4vars.ini,chans,%i)) {
      inc %i
    }
    writeini cmd4vars.ini chans %i $did(cmd4options,6,1).text
    did -r cmd4options 6
    did -a cmd4options 4 $readini(cmd4vars.ini,chans,%i)
  }
}

Chunk of dialog
Code:
;
  list 4, 4 20 50 100, tab 1
  text "New Channel:", 5, 4 115 35 10, tab 1
  edit "#", 6, 39 114 50 9, tab 1 autohs
  button "Add", 7, 91 114 20 9, tab 1
  button "Remove", 8, 56 20 25 9, tab 1
;

If someone could help I would greatly appreciate it grin

Last edited by benjy355; 18/11/05 05:29 AM.

Chat NSN
My Server: sleepystickman.ircxpro.com
Re: Script not saving, no errors too. #135858 18/11/05 05:35 AM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You have the event and id portions of the on DIALOG line transposed.

You have: on *:dialog:cmd4options:7:sclick: {

Correct: on *:dialog:cmd4options:sclick:7: {

There are some problems with the rest of the code as well. Here is a version that works the way I think you intended:

Code:
 on *:dialog:cmd4options:sclick:7: {
  if (#?* !iswm $did(cmd4options,6).text) return

  writeini cmd4vars.ini chans $did(cmd4options,6,1).text $ctime
  did -a cmd4options 4 $did(cmd4options,6,1).text
  did -ra cmd4options 6 $chr(35)
} 


You were missing the 'value' for the writeini command, so I used $ctime for lack of something better to use. You will be able to tell when you added that channel to the list. :P

-genius_at_work

Last edited by genius_at_work; 18/11/05 05:38 AM.