|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
OP
Fjord artisan
Joined: Oct 2007
Posts: 214 |
Hello, I am trying to create a dialog with a bunch of check boxes,
dialog new_table {
title "New Project"
size -1 -1 103 75
option dbu
box "", 2, 1 0 100 73
text "Log the following:", 6, 4 5 51 8
check "Kicks", 14, 52 14 24 10
check "Text", 11, 52 23 24 10
check "Actions", 27, 52 32 28 10
check "Aways", 12, 52 41 28 10
check "Returns", 13, 52 50 31 10
check "IP Address", 7, 6 14 40 10
check "GateKeeper", 8, 6 23 40 10
check "Joins", 9, 6 32 26 10
check "Parts", 10, 6 41 24 10
check "Quits", 15, 6 50 26 10
}
And using an ini file with the line: test.ini [Settings] Log=IP,GATE,JOINS,PARTS,QUITS,KICKS,TEXT,ACTION,AWAY,RETURN How can I make the dialog read from the ini file with this line and tick off the boxes based on what items are in the Log? This is what I have so far although I think it might be really sloppy and pourly written:
var %f = $+($scriptdir,seen\,seen.ini)
var %log = $readini(%f,Settings,Log)
Tokenize 44 %log
if (IP isin $1-) { did -c $dname 7 }
Any help is greatly appreciated. Thanks a bunch. Cheers, Jay
Last edited by Buggs2008; 09/10/08 06:36 PM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Try this modification. Note: There are a fair number of changes in the code and method used for storing the ini information. dialog new_table {
title "New Project"
size -1 -1 103 75
option dbu
box "", 2, 1 0 100 73
text "Log the following:", 6, 4 5 51 8
check "Kicks", 12, 52 14 24 10
check "Text", 13, 52 23 24 10
check "Actions", 14, 52 32 28 10
check "Aways", 15, 52 41 28 10
check "Returns", 16, 52 50 31 10
check "IP Address", 7, 6 14 40 10
check "GateKeeper", 8, 6 23 40 10
check "Joins", 9, 6 32 26 10
check "Parts", 10, 6 41 24 10
check "Quits", 11, 6 50 26 10
}
on *:dialog:new_table:init:*:{
var %f = $+($scriptdir,seen\,seen.ini), %log = $readini(%f,Settings,Log), %a = 7
while %a <= 16 {
var %id = $findtok(%log,$did(%a),1,44)
if %id {
inc %id 6
did -c $dname %id
}
inc %a
}
}
seen.ini [Settings] Log=IP Address,GateKeeper,JOINS,PARTS,QUITS,KICKS,TEXT,ACTIONS,AWAYS,RETURNS
|
|
|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
In this case, the dialog id should be rewrote in order, and then you could probably use your tokenize with $* in the $findtok, and in general with $***tok identifier, N parameter is 1 by defaut, so not needed here
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
|