Jump to content

Valid Key Check


Chobyhy
 Share

Recommended Posts

I'm trying to write a script for a game and I'm going to be giving it to few of my friend. But i was wondering if it is possible for the script to check some kind of file online (such as text file) which will be filled with valid key. Users will be inserting a Valid key into the .ini file and i was wondering if a script can take the key that was entered in ini file and check it with a file on the internet. If such key that was entered into ini file matches with one of the keys, its valid. if the key is not valid the script will terminate instead of running.

Is this possible? and anyone would like to help me with this?

Link to comment
Share on other sites

  • Moderators

I'm trying to write a script for a game and I'm going to be giving it to few of my friend. But i was wondering if it is possible for the script to check some kind of file online (such as text file) which will be filled with valid key. Users will be inserting a Valid key into the .ini file and i was wondering if a script can take the key that was entered in ini file and check it with a file on the internet. If such key that was entered into ini file matches with one of the keys, its valid. if the key is not valid the script will terminate instead of running.

Is this possible? and anyone would like to help me with this?

Yes it's possible... There was a support question on checking version numbers in the last day or 2... the setup would be the same I'm sure.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

hmm there

Func CheckCharName()
    Dim $i,$j,$hash = 0, $color
    Send($CharacterScreen_key)
    $Timer=TimerInit()+501
    $ErrorCount = -1
    Do
        If TimerDiff($Timer) > 500 then
            $ErrorCount = $ErrorCount + 1
            if $ErrorCount > 0 then LogEvent(3,$ErrorCount & " timeout when trying to get character screen on, retrying")
            Send($CharacterScreen_key)
            $Timer=TimerInit()
        EndIf
        Sleep(20)
        If $ErrorCount > 3 then
            LogEvent(3,"Unable to get character screen on")
            Exit 0
        EndIf
    Until (PixelGetColor($CenterX-190,$CenterY-143) == 10872831) and (PixelGetColor($CenterX-197,$CenterY-144) == 4869450)
    For $i=$CenterX - 307 To $CenterX - 146 step 2
        For $j=$CenterY-521 to $CenterY-507 step 2
        $Color = PixelGetColor($i,$j)
        Select
            case $Color == 1024
                $hash = $hash/2
            case $Color == 13027270
                $hash = $hash*1.5
            case $Color == 527368
                $hash = $hash*3
            case $Color == 1052688
                $i = $i + 1
            case $Color == 8685188
                $hash = $hash/10
            case else
                $hash = $hash + $color
        EndSelect
        Next
    Next
    While $hash > 20000000000
    $hash = $hash / 2.56
    Wend
    $hash = round($hash,0)
    If $hash * 1.5 <> $Hash_oryg * 1.5 then
        LogEvent(3,"Wrong character name / corrupted hash code.")
        LogEvent(3,"Test on single player if character TestBot is working.")
        LogEvent(3,"If so then conatact me - RaukBot@o2.pl")
        exit 0
    EndIf
    $Timer=Timerinit()
    Send($CharacterScreen_key)
    $ErrorCount = 0
    While (PixelGetColor($CenterX-190,$CenterY-143) == 10872831) and (PixelGetColor($CenterX-197,$CenterY-144) == 4869450)
        If TimerDiff($Timer) > 500 then
            $ErrorCount = $ErrorCount + 1
            LogEvent(3,$ErrorCount & " timeout when trying to get character screen off, retrying")
            Send($CharacterScreen_key)
            $Timer=TimerInit()
        EndIf
        Sleep(20)
        If $ErrorCount > 3 then
            LogEvent(3,"Unable to get character screen off")
            Exit 0
        EndIf
    Wend
    LogEvent(1,"Hash is correct, bot will continue")
EndFunc

not sure how to generate the hash itself, you prob gonna need to play with that function.

the mod can be found at http://www.mmbot.net/modules.php?name=Foru...;highlight=rauk

Link to comment
Share on other sites

Wait, Something isnt right. There isnt a url that checks with the site. What i need is something like when mm checks the detectable status.

well this would be good since you could provide your friends with hash files for theyre character names.

I dont see how you could use a downloaded file to check if the user can run your script, since anyone would download the same file.

Link to comment
Share on other sites

  • Moderators

Yes it's possible... There was a support question on checking version numbers in the last day or 2... the setup would be the same I'm sure.

This is just an outline of what you would need to do, I didn't write the script for anyone, you can do that with this info: http://www.autoitscript.com/forum/index.ph...st&p=230375

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

This is what im planning to do.

Its like a cd key function. If some one down loads my file they will have to config it and one of they will say Key= and they have to type in a key. So for my friends, i will each give them a seperate key and they have to put the keys i gave them in the key= section. and then when it is launched the script will go to my site and check a file. File containing all valid keys. So if what they put in config matches one of the keys in the valid key files, then the program will run, if they put a wrong key that is not in the files, then it will terminate.

Link to comment
Share on other sites

mmstatus download an ini file using InetGet() function and then check this ini file (located locally on the computer). This is why I told you I dont see if you could do it the way you want.

maby you can have a look at tcp functions in the docs but I don't know enough about tcp so I cant tell (and probabbly you will need good tcp base knowledge to make something like this work)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...