• Welcome to Valhalla Legends Archive.
 

Finding

Started by TriCk, May 24, 2003, 06:04 AM

Previous topic - Next topic

TriCk

How Do I find a username on a txt file or a listbox?
in Code please not Case

CrAz3D

Which one are you tryin to find it from?
Like add a name to a ListBox from (for example) users.txt?

Quote
Public Sub FillList()
LISTBOX.Clear

           s = dir$(App.Path & "\TEXT.txt")
           If s = "" Then
               Open (App.Path & "\TEXT.txt") For Output As #1
               Close #1
           End If

   Open (App.Path & "\TEXT.txt") For Input As #1
   
   On Error Resume Next
   Do
       Input #1, z
       LISTBOX.AddItem (z)
   Loop Until EOF(1)
   Close #1
end sub
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

TriCk

umm i know how to load from to and from a listbox

I dont really need that i wanna know how to find something in a txt file like a shitlist, if someone joins the channel and they're on it ban them...

Kp

Quote from: TriCk on May 24, 2003, 06:43 PM
umm i know how to load from to and from a listbox
I dont really need that i wanna know how to find something in a txt file like a shitlist, if someone joins the channel and they're on it ban them...
Setting aside that loading from a text file to test for bannables is a bad idea for efficiency reasons:
int fd = open ("banlist.txt", O_RDONLY);
/* InFile(int fd, const char *sz) checks to see if any entry in the newline delimited file attached to fd matches the string in sz.  Matches are literal.  Use InFile_Wild() for wildcard matching.
*/
if (InFile (fd, szJoiningUser))
   queuetxt ("/ban %s Autoban", szJoiningUser);
close (fd);
Required headers: fcntl.h, stdio.h (iirc); see the manpage for open(2) to confirm.  Remember to close the descriptor afterward with close(2), or your program will leak descriptors.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

TriCk



TriCk

in vb please  :-\
thanx anyway  ______

______

np
are you tring to find a user in your database?
or tring to load the user into the database from a text file?

TriCk

Either find the user in a listbox
Or
Find them in Users.txt


Ive got the listbox loading and saving Users.txt
to add some and shit
but i dunno how to safelist all of em...

______

either make a diffrent listbox and name it safelist check to see if there on the list if there on the list dont ban them else ban them.

or another possiblility is make a listview and give the user the tag of "S". When the user joins the channel check the tag. if the Tag is "S" then dont ban them else Ban them. hope this helps some.