Skip to content
MSN

listing problem...

A TG007 community discussion started by SpAzZ.

Discussion 9 posts
Page 1 of 1
Open
Topic #799 · 9 published posts · 809 views

Aight, how do i make the info in my ini banlist file read into my dialog? Ive tried numerous things, but nothing works. Thanks,

--SpAzZ--

dialog hsb {
 title "((~))Hydro Scriptaz Banlist dialog((~))"
 size -1 -1 128 74
 option dbu
 list 1, 2 2 82 56, size
 button "Add User", 2, 88 2 38 12, flat
 button "Remove User", 3, 88 16 38 12, flat
 button "Ban User", 4, 88 30 38 12, flat
 button "Refresh List", 5, 88 44 38 12, flat
 button "Done", 6, 2 60 124 12, flat ok
}
on *:dialog:hsb:init:0:{
}
on *:dialog:hsb:sclick:2:{
 dialog -m add add
}
on *:dialog:hsb:sclick:3:{
 remini(banlist.ini, n, banlist, $did(hsm,1).seltext
 /refreshlist
}
on *:dialog:hsb:sclick:4:{
 access $chan add deny $did(hsm,1).seltext
}
on *:dialog:hsb:sclick:5:{
 /refreshlist
}

use loop such as:

 

on *:dialog:<dialog name>:init:0:{
/brefresh
}

alias brefresh {
var %x 1
while (%x <= $lines(file name and do not forget directory if it is not the same as mirc.exe)) {
did -a <dialog name> <id of your list>
inc %x
}
}

Edited Jul 7, 2004 7:55 PM by DreaM

it still doesn't work notworking.gif

on *:dialog:hsb:init:*:{ refreshlist }
alias refreshlist {
 var %x = 1
 while (%x <= $lines($shortfn(<directory\file.ini>))) {
   did -a $dname 1 $$gettok($read($shortfn(<directory\file.ini>),%x),2,61)
   inc %x
 }
}

 

that should work as long as your file is an ini file in the form of...

[*]

*=USER

*=USER

*=USER

...etc..

Edited Jul 7, 2004 8:58 PM by vexation

bfush.PNG

Thanks for tryin vexation, but it still doesn't work sad.gif

--SpAzZ--

just a sugestion maybe if you put all the code that goes with your banlist people will be able to figure out what isnt working and then can give you the right answer

 

open his box of pizza.gif and sits down to eat

heres all the coding.

dialog hsb {
 title "((~))Hydro Scriptaz Banlist dialog((~))"
 size -1 -1 128 74
 option dbu
 list 1, 2 2 82 56, size
 button "Add User", 2, 88 2 38 12, flat
 button "Remove User", 3, 88 16 38 12, flat
 button "Ban User", 4, 88 30 38 12, flat
 button "Refresh List", 5, 88 44 38 12, flat
 button "Done", 6, 2 60 124 12, flat ok
}
on *:dialog:hsb:init:*:{ refreshlist }

on *:dialog:hsb:sclick:2:{
 dialog -m adduser adduser
}
on *:dialog:hsb:sclick:3:{
 remini(banlist.ini, n, banlist, $did(hsm,1).seltext
 /refreshlist
}
on *:dialog:hsb:sclick:4:{
 access $chan add deny $did(hsm,1).seltext
}
on *:dialog:hsb:sclick:5:{
 /refreshlist
}
menu menubar,channel,nicklist {
 Banlist Dialog:dialog -m hsb hsb
}

dialog adduser {
 title "Add User"
 size -1 -1 98 40
 option dbu
 text "Address:", 1, 2 2 22 8
 edit "", 2, 26 2 70 8, autohs
 text "Reason:", 3, 2 12 22 8
 edit "", 4, 26 12 70 8, autohs
 button "Add User", 5, 2 22 94 8
 button "Cancel", 6, 2 32 94 8, ok cancel
}
on *:dialog:adduser:sclick:5:{
 set %addy $did(adduser,2)
 set %reason $did(adduser,4)
 /writeini banlist.ini Banlist %addy %reason
}
alias refreshlist {
 if ($dialog(hsb).hwnd) {
  ;dnum = 1 (list)
   did -r hsb 1
   var %i = 1
   while (%i <= $ini(banlist.ini,banlist,0)) {
     did -a hsb 1 $ini(banlist.ini,banlist,%i)
     inc %i
   }
 }
}

 

my banlist is in this format.

[Banlist]
*!*83EB65AE5@GateKeeper=bleh
*!*FA41ED1CD@GateKeeperPassport=Spec
*!*0C4CB2F4B@GateKeeper=cuz i want 2 :|

here ya go tongue.gif

 

oh.. well in that case..

alias refreshlist {
 unset %cc
 var %f = $shortfn(banlist.ini), %c = 1
 while (%c <= $lines(%f)) {
   if (%cc == $true) {
     if ([*] iswm $read(%f,%c)) { unset %cc | return }
     else { did -a $dname 1 $gettok($read(%f,%c),1,61) | inc %c | continue }
   }
   if ([bans] == $read(%f,%c)) { set %cc $true | inc %c | continue }
   inc %c
 }
}

maybe?

Edited Jul 10, 2004 2:48 AM by vexation

bfush.PNG

notworking.gif

--SpAzZ--