Sign in to follow this  
Followers 0
Medic873

Array Use

11 posts in this topic

Okay this might be simple for some of you but im just kind of confused about how to set this up..

#include<misc.au3>
#include <ScreenCapture.au3>
#Include<file.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

$Login = @UserName;this is going be how we determ if they are registered user

if $login = "AH1320" Then
    msgbox (0, "Account Disabled", "Sorry  but the adminstrator has disabled your account.");
endif

if $login = "TE28544" Then
    msgbox (0, "Account Disabled", "Sorry you know who you need to talk to. If you want this account re activated.");
EndIf



else
    msgbox (0, "Welcome", "Welcome to full access.");opens the gui here in a minute.
    
EndIf

elseif ;opens gui for non members
;gui
endif

What i want to do is make a massive array so I can say

these people are members

to123299

fe293811

fo489824

fd912839

these people get a msgbox message

fo123983

oi491284

ox139485

and these people get a different gui complete

can you please help

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What i want to do is make a massive array . . . .

can you please help

How massive? And how are you going to maintain this? Edited by JoHanatCent

Share this post


Link to post
Share on other sites

If mutliple arrays and SQLite are out of the questions I can think of two practical ways to do this:

First way is to make the array 2d and use a column for the usernames and one for a state identifier:

If the identifier is 0, the account has never been activated.

If the identifier is 1, the account has been banned.

If the identifier is 2, the account is suspended.

If the identifier is 3, the account is activated.

If the identifier is ,,,, etc

As you can see it'll be easy to accomodate for different account states this way.

The other way would use the same system, but instead of using a 2D array you concatenate the username to the the account state like this: "3to123299" -> "3" and "to123299" -> account "to123299" is active.

this has the benefit of using a 1D array, which works a little better with some of the _Array functions, but it's down to preference.

It does seem like SQLite would be the ideal solution though, as you can basically ask for the account state for user to123299, but also request all users with account state 3 etc and it will be much easier to add information to accounts without needing to rewrite allot of code. Like if you want to add reasons as to why someone got suspended etc.

Share this post


Link to post
Share on other sites

Okay let me explain a bit more...

http://freetexthost.com/hsnfi4iztv

there are all they accounts how can I say if the username has a -1 by it do this if it has a -2 by it do this and if it dosnt have anything then do this.

Share this post


Link to post
Share on other sites

Hi Medic873,

maybe you want to tell us how you maintain the list of users that are full-members, banned or locked.

Do you work in a local environment or just distribute the exe?

If you'd have all values in an array you could use _ArraySearch() to for the username.

If you look at its options in the help you can define a partial search.

And if you've got the position in the array, read the element and see if there's a "-1" or "-3" at the end!

Regards,

Hannes

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

im going maintain this list thorough freetexthost.com you see I can update the information. with the admin password.

so all I do is distibute my exe

Share this post


Link to post
Share on other sites

Hi Medic873,

I guess/suggest you use InetGet() to retrieve the file.

Then you can translate the html file with string operations until you have a list of usernames you could maintain in an array.

That should do the trick.

Regards,

Hannes


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

okay sounds good could you give me a example

Share this post


Link to post
Share on other sites

Hi Medic873,

let's say you started the list in the internet by <userstart> and end it with <userend>

<userstart>

user1-0

user2-1

user3-0

...

<userend>

#include <file.au3>

dim $aHTML, $sTempFile
dim $j = 0

$sTempFile = _TempFile()

InetGet("http://freetexthost.com/hsnfi4iztv",$sTempfile,1)

_FileReadToArray($sTempFile,$aHTML)

FileDelete($sTempFile)

Dim $aList[$aHTML[0]]

For $i=1 To $aHTML[0]

  If StringInStr("<userstart>", $aHTML[$i]) Then $bUserlist = True

  If StringInStr("<usersend>", $aHTML[$i]) Then $bUserlist = False

  If $bUserlist Then 
    $j += 1
    $aList[0] = $j
    $aList[$j] = $aHTML
  EndIf

Next

This comes without any guarantee. ;-)

Regards,

Hannes


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I can't test, because the site seems down for me. (even though http://www.isup.me/http://freetexthost.com/hsnfi4iztv claims it's up) but Hannes suggestion seems worakable, except that I'd use InetRead instead of InetGet.

heh works when I use a proxy ^^ what's going on here?

Edited by Tvern

Share this post


Link to post
Share on other sites

Hi Tvern,

maybe you're right. Using InetRead over InetGet has the advantage of not having to create a file. :-)

Regards,

Hannes


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0