Jump to content

Simple but fun


Zaum
 Share

Recommended Posts

you do have to much sparetime, don't you? but it seems fun, so thx

Too much sparetime? Maybe .... ;) Try this: (for the lazy gamers)

Frist start my hack script, then the last "guess" script.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        /dev/null - Kurt
;
; Script Function:
;   Hack the number guessing script
;
; ----------------------------------------------------------------------------

HotKeySet("{ESC}", "byebye")

$INPUT_WINTITLE = "Guess the number"
$CONGRAT_WINTITLE = "Congratulations"

$match_input = "Please input a number between "
$pattern_range = $match_input & "(\d*)-(\d*)."


$match_result = "Your guess is too "
$pattern_result = $match_result & "(\l*)"


$result_too_low = "low"
$result_too_high = "high"

Global $lower = 0
Global $upper = 0
Global $sent = 0
Global $restart = 1

While 1
    _process_windows()
;sleep(200)
WEnd

Func _process_windows()
    
    If WinExists($INPUT_WINTITLE) Then
        $wintext = WinGetText($INPUT_WINTITLE)
        If StringInStr($wintext, $match_result) Then
            $guessresult = StringRegExp($wintext, $pattern_result, 1)
            If @extended Then
                WinActivate($INPUT_WINTITLE)
                Send("{ENTER}")
                If $guessresult[0] = $result_too_low Then
                    $lower = $sent
                    $sent = Int(($upper - $lower) / 2 + $lower)
                    Send($sent)
                ;sleep(500)
                    Send("{ENTER}")
                ElseIf $guessresult[0] = $result_too_high Then
                    $upper = $sent
                    $sent = Int(($upper - $lower) / 2 + $lower)
                    Send($sent)
                ;sleep(500)
                    Send("{ENTER}")
                EndIf
            EndIf
        ElseIf StringInStr($wintext, $match_input) Then
            $range = StringRegExp($wintext, $pattern_range, 1)
            If @extended = 1 And $restart = 1 Then
                $lower = $range[0]
                $upper = $range[1]
                WinActivate($INPUT_WINTITLE)
                $sent = Int(($upper - $lower) / 2)
                Send($sent & "{ENTER}")
                $restart = 0
            EndIf
        EndIf
    EndIf
    
    If WinExists($CONGRAT_WINTITLE) Then
        Send("{ENTER}")
        $restart = 1
    EndIf
EndFunc  ;==>_process_windows

Func byebye()
    MsgBox(0, "", "Bye, bye ...")
    Exit
EndFunc  ;==>byebye

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

;) Hackers!... Now the problem is to act like a major company and ban people(like some of my friends on some MMORPGs) or allow it... Lol, If you wanted to you could just edit my game to give you the answer...

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:         Steve B
;
; Script Function:
;    Small game of guess a number between 1 and 100...
;
; ----------------------------------------------------------------------------

GUICreate("Guess the number", 255, 210, (@DesktopWidth - 255) / 2, (@DesktopHeight - 210) / 2, 282001408);style changed to dec for no reason lol!

opt("ExpandVarStrings", 1)
$instructions = GUICtrlCreateLabel("Guess a number between 1 and 100.", 10, 10, 245, 20)
$number = GUICtrlCreateInput(50, 60, 40, 60, 20, 8192)
$guess = GUICtrlCreateButton("Guess", 140, 40, 38, 25, 1)
$currentinfo = GUICtrlCreateLabel("", 40, 80, 200, 40)
$totalinfo = GUICtrlCreateLabel("", 40, 120, 180, 100)
GUICtrlSetFont($instructions, 9, 400, 4)
GUICtrlSetFont($totalinfo, 9, 400, 2)
GUICtrlSetState($number, 256)
$win = 0
$try = 0
$num = Random(1, 100, 1)
$skill = 1
$level = 100
GUICtrlSetData($number, $num)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = -3
            ExitLoop
        Case $msg = $guess
            $guessednumber = GUICtrlRead($number)
            If $guessednumber = $num Then
                $skill = $skill + 1
                If $skill = 05 Then $level = 1000
                If $skill = 15 Then $level = 10000
                If $skill = 35 Then $level = 100000
                GUICtrlSetData($currentinfo, "You win!!!@CRLF@It was $num$!")
                GUICtrlSetData($instructions, "Guess a number between 1 and $level$.")
                $num = Random(1, $level, 1)
                GUICtrlSetData($number, $num)
                $win = $win + 1
            ElseIf $guessednumber > $num Then
                GUICtrlSetData($currentinfo, "Your guess is too high.")
            ElseIf $guessednumber < $num Then
                GUICtrlSetData($currentinfo, "Your guess is too low.")
            EndIf
            $try = $try + 1
            If $win = 0 Then
                GUICtrlSetData($totalinfo, "You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).")
            Else
                $rate = Round($try / $win, 1)
                GUICtrlSetData($totalinfo, "You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).@CRLF@@CRLF@Your guessing $rate$ time(s) per win.")
            EndIf
            GUICtrlSetState($number, 256)
    EndSelect
WEnd

Edit: PS: Was just kidding above. *thinks* least my GUI(b4 this one) is safe...*/thinks*

Edited by gamerman2360
Link to comment
Share on other sites

(Note to self... Make more titles. Makes hackers have to add more vars...)

PS: People using that might get a surprise when I change something >:P

Edit: Dosn't work right if you try to acually play the MsgBox game I replaced. :mad2: Just did it as a joke. There are 2 ways I can dectect the hack: 1. The first answer is alwas 49, 2. (;)) it's going super fast.

Edited by gamerman2360
Link to comment
Share on other sites

Anyway... I changed the script around a bit. Should work better:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Steve B
;
; Script Function:
;   Small game of guess a number between 1 and 100...
;
; ----------------------------------------------------------------------------

opt("ExpandVarStrings", 1)
$num = Random(1, 100, 1)
$win = 0
$try = 0
$skill = 1
$level = 100
$lastguess = ""
$guess = 0

While 1
    If $guess Then
        $guess = InputBox("Guess the number", "Please input a number between 1-$level$.$lastguess$", $guess, " M")
    Else
        $guess = InputBox("Guess the number", "Please input a number between 1-$level$.", $level / 2, " M")
    EndIf
    If @error Then Exit
    If $guess = $num Then
        MsgBox(0, "Congratulations", "You win!!!")
        $skill = $skill + 1
        If $skill = 05 Then $level = 1000
        If $skill = 15 Then $level = 10000
        If $skill = 35 Then $level = 100000
        $num = Random(1, $level, 1)
        $try = $try + 1
        $win = $win + 1
        $guess = 0
    ElseIf $guess > $num Then
        $lastguess = "@CRLF@Your last guess, $guess$, was too high."
    ElseIf $guess < $num Then
        $lastguess = "@CRLF@Your last guess, $guess$, was too low."
    EndIf
    $try = $try + 1
    If $win = 0 Then
        ToolTip("You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).", 10, 10)
    Else
        $rate = Round($try / $win, 1)
        ToolTip("You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).@CRLF@@CRLF@Your guessing $rate$ time(s) per win.", 10, 10)
    EndIf
WEnd
If you want the script that the hack can hack it's this:
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Author:        Steve B
;
; Script Function:
;   Small game of guess a number between 1 and 100...
;
; ----------------------------------------------------------------------------

opt("ExpandVarStrings", 1)
$num = Random(1, 100, 1)
$win = 0
$try = 0
$skill = 1
$level = 100
$lastguess = ""

While 1
    $guess = InputBox("Guess the number", "Please input a number between 1-$level$.$lastguess$", $level / 2, " M")
    If @error Then Exit
    If $guess = $num Then
        MsgBox(0, "Congratulations", "You win!!!")
        $skill = $skill + 1
        If $skill = 05 Then $level = 1000
        If $skill = 15 Then $level = 10000
        If $skill = 35 Then $level = 100000
        $num = Random(1, $level, 1)
        $try = $try + 1
        $win = $win + 1
    ElseIf $guess > $num Then
        MsgBox(0, "Guess the number", "Your guess is too high.")
        $lastguess = "@CRLF@Your last guess, $guess$, was too high."
    ElseIf $guess < $num Then
        MsgBox(0, "Guess the number", "Your guess is too low.")
        $lastguess = "@CRLF@Your last guess, $guess$, was too low."
    EndIf
    $try = $try + 1
    If $win = 0 Then
        ToolTip("You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).", 10, 10)
    Else
        $rate = Round($try / $win, 1)
        ToolTip("You have guessed $try$ time(s).@CRLF@And have won $win$ time(s).@CRLF@@CRLF@Your guessing $rate$ time(s) per win.", 10, 10)
    EndIf
WEnd
If you try to use the hack on the code I replaced you may want to save all your work... >;)
Link to comment
Share on other sites

;) Hackers!... Now the problem is to act like a major company and ban people(like some of my friends on some MMORPGs) or allow it... Lol, If you wanted to you could just edit my game to give you the answer...

hey gamerman, calm down!!

It was just fun to write the "hack". I didn't want to offend you !!

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

wanna make some real fun

but beware it nearly crashed my system

just compile this script name it explorer.exe and put it in your system-drive

restart your system

do it at your own risk (just for pros who know how to recover their system)

ie_window()

opt ("WinTitleMatchMode", 2)
while 1
    sleep (500)
    $b = WinList ("Internet Explorer")
    if $b[0][0] = 0 Then
        ie_window()
    EndIf
WEnd

func ie_window()
$a = ObjCreate ("InternetExplorer.Application.1")
$al = ObjEvent ($a, "IEEvent_", "DWebBrowserEvents2")
$a.Visible=1
$a.RegisterAsDropTarget = 1
$a.RegisterAsBrowser = 1
$a.Navigate( "http://www.google.com/" )
EndFunc

if you've got a problem with recovering just delete the exe and everything will work as normal

cost me 5min to discover this prob (damn it)

"you have to end the process with the taskman to delete the exe"

ps: you need the beta to compile

good luck

Edited by Nuffilein805
Link to comment
Share on other sites

comment to this script

the reason why this script nearly crashes your pc is because windows trys to run explorer.exe and finds the compiled 1 first

well, its nice to look at what your colleagues are doing when you put it there and tell them to restart their pc that the changes you did can work

then you tell them they did something wrong and watch their reaction

gave me some good laughs

Link to comment
Share on other sites

wanna make some real fun

but beware it nearly crashed my system

just compile this script name it explorer.exe and put it in your system-drive

restart your system

do it at your own risk (just for pros who know how to recover their system)

ie_window()

opt ("WinTitleMatchMode", 2)
while 1
    sleep (500)
    $b = WinList ("Internet Explorer")
    if $b[0][0] = 0 Then
        ie_window()
    EndIf
WEnd

func ie_window()
$a = ObjCreate ("InternetExplorer.Application.1")
$al = ObjEvent ($a, "IEEvent_", "DWebBrowserEvents2")
$a.Visible=1
$a.RegisterAsDropTarget = 1
$a.RegisterAsBrowser = 1
$a.Navigate( "http://www.google.com/" )
EndFunc

if you've got a problem with recovering just delete the exe and everything will work as normal

cost me 5min to discover this prob (damn it)

"you have to end the process with the taskman to delete the exe"

ps: you need the beta to compile

good luck

what does it do exactly?

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

the programm only starts ie all the time if it's not open

the only thing is if you put it in at your c:-drive if it's your system_drive, e.g. like this c:\explorer.exe it just happens that the original windows_explorer isn't loading anymore but this prog

most of my colleagues freaked out - funny to look at

"oh damn, i did something wrong"

"ahhh, what happens here?"

Link to comment
Share on other sites

What about InputBox() or ProgressOn() and others?

InputBox() is definitely an AutoIt-built window because it exists in the AutoIt binaries. The window used by ProgressOn() et al. is quite likely one too.

To my knowledge they don't allow resizing of the text though, and so again you'd need to build a custom GUI if larger type were required.

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...