mIRC Home    About    Download    Register    News    Help

Print Thread
#215157 05/09/09 03:44 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's the code that I've started on, and I've already run into a problem.
As specified in the subject line, the ini file isn't being written to the specified location and I've run out of ideas as to why.
Code:
menu * {
  Auto-Connect
  .Add
  .. $network : auto-connect add $network $server $port $$input(Group name,e,,$network)
  .. Other network : {
    var %network.name = $$input(Enter network name,e)
    auto-connect add %network.name $$input(Enter server address",e,%network.name) $$input(Enter port number or range,e,%network.name,6667) $$input(Group name,e,%network.name,%network.name)
  }
  .Delete
  .. $network : auto-connect del $network
  .. Other network : auto-connect del $$input(Enter network name,e)
  .List : auto-connect list
}
alias -l auto-connect {
  if $1 == add {
    writeini -n $scriptdirAuto-connect.ini $2 $3 $4 $5
    if $readini($scriptdirAuto-connect.ini,n,$2,$3) == $4 $5 {
      .echo -a Network: $2 Server: $3 Port: $4 Group: $5 Added to Auto-Connect file
    }
    else {
      .echo -a Error Network: $2 Server: $3 Port: $4 Group: $5 Not added to Auto-Connect file
    }
  }
  elseif $1 == del {
    remini $scriptdirAuto-connect.ini $2
  }
  elseif $1 == list {
    if !$window(@Auto-Connect) { window @Auto-Connect }
    var %a = 1, %b = $ini($scriptdirAuto-Connect.ini,0)
    while %a <= %b {
      .aline @Auto-Connect $ini($scriptdirAuto-Connect.ini,%a)
      var %c = 1, %d = $ini($scriptdirAuto-Connect.ini,%a,0)
      while %c <= %d {
        .aline -i @Auto-Connect $ini($scriptdirAuto-Connect.ini,%a,%c)
        inc %c
      }
      inc %a
    }
  }
}

For now, only pay attention to the part of the code for adding a network.

Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Most obvious answer: there's a space in your $scriptdir path.

Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks.. and that was the problem.. Code has been modified to use $qt($scriptdirAuto-Connect.ini)


Link Copied to Clipboard