Need script for a game

Ask gaming related questions
piciojunior
Posts: 1
Joined: 26 Jan 2016, 10:45

Need script for a game

26 Jan 2016, 11:03

Hey , I'm Italian and I'm new in the world of AutoHotkey . I wuold ask you for one problem that afflicts me, I need one script for Rust . It's a game survival for pc and i need a script for open door protected from pin of 4 numbers that test all numbers from 0000 at 9999 ( like bruteforce 8-). The script must do:
1) Press "E" for insert the code and Hold "E"
2) Insert the code ( 0000, 0001 , 0002 ... )
3) Press Enter
4) Wait 2 seconds
5) Try again if the door did not open

The script must work with a game, how to use it?

Sorry for my bad english. Thanks very much !
I attach one photo for make idea for the script
Spoiler
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Need script for a game

26 Jan 2016, 14:24

I think it would take ages to find the code tho, you probably get killed in the progress lol
User avatar
SnowFlake
Posts: 368
Joined: 28 Apr 2015, 05:41
Google: floowsnaake
GitHub: floowsnaake
Contact:

Re: Need script for a game

26 Jan 2016, 15:14

it would take like 5 hours doing the code from 0000 to 9999 xD
:yawn:
Shadowpheonix
Posts: 1259
Joined: 16 Apr 2015, 09:41

Re: Need script for a game

27 Jan 2016, 11:19

If you really want to do it, this code should work (although I have not tested it myself). It will take a little over 5 hours and 33 minutes to try all 10000 codes. I have set it up so that if you release the key, then press it again, it will continue where it left off (although rebooting or otherwise reloading the script will also reset it).

Code: Select all

PassCode = 0000    ; Get the variable ready for the first use (just in case you forget to manually reset it).

#IfWinActive, ahk_exe Rust.exe    ; Makes the following code only work with you are in your game.  You will likely need to edit this line

^e::PassCode = 0000    ; Ctrl+E used to manually reset the PassCode back to 0000.  Use this before trying a new door.

e::    ; Press & hold E to try and open a door.
While GetKeyState("e","P")    ; Loops as long as you are holding E down.
{
    Send e%PassCode%{Enter}    ; Sends E followed by the current pass code followed by Enter.
    Sleep 2000    ; Waits 2 seconds
	PassCode := PassCode + 1    ; Increases the pass code by 1
	If PassCode = 10000    ; Check if the pass code exceeds 9999
	{
        MsgBox All codes have been tried!    ; Inform the user that all the codes have been tried.
        PassCode = 0000    ; Reset the pass code to 0000 for the next door.
		Break    ; Break out of the loop even if E is still held down.
    }
    PassCode := Format("{1:04}",PassCode)    ; Ensure the increased pass code is 4 digits.
}
Return    ; Ends the code for the E hotkey.
#IfWinActive    ; Ends the previous #IfWinActive statement.
Lebastard
Posts: 49
Joined: 21 Oct 2014, 09:01

Re: Need script for a game

27 Jan 2016, 12:39

Nice shadowpheonix, but 5 hours in a row on 1 lock it's suspicious + he probably get's killed in the progress by people anyway :P
Shadowpheonix
Posts: 1259
Joined: 16 Apr 2015, 09:41

Re: Need script for a game

27 Jan 2016, 16:35

Lebastard wrote:Nice shadowpheonix, but 5 hours in a row on 1 lock it's suspicious + he probably get's killed in the progress by people anyway :P
Honestly, I wrote the code simply for the practice. I agree that it is likely be too slow to be useful, but a 2 second delay between attempts will do that.

Return to “Gaming”

Who is online

Users browsing this forum: britguy234 and 10 guests