Jump to content

Looping Through Combinations


Recommended Posts

Hi Guys and Gals,

I'm attempting to write a script that will give me an output of all the possible combinations of a predifined set. For example I have five letters "P, K, R, A, W" that I want to run through and get every last combination from it.

Such as if I had then numbers 0, 1, 2 and a 3 digit combination I would have Twenty Seven different outcomes ranging from 000, 001 - 221, 222.

I wouldn't have a problem if I were ok with having repeated outcomes or writing a long list of code but I do not want repeats and I want to eventually set up a GUI based system to accept Alpha & Alphanumeric characters of any length and do what I am looking for now.

This is the basic layout I have:

#include <GUIConstantsEx.au3>
#include <Array.au3>
#include <StaticConstants.au3>
Const $title = "Combinator"
Global $wX = 300, $wY = 25
Local $array[5] = ["P", "K", "R", "A", "W"]
GUICreate($title, $wX, $wY)
GUICtrlCreateLabel("COMBINATIONS", 5, 5, $wX - 10, $wY - 10, $SS_CENTER)
GUISetState()
While 1

$msg = GUIGetMsg()

Select
case $msg = $GUI_EVENT_CLOSE
  Exit
EndSelect

WEnd
Func _generate()

;Combo Loop

Sleep(5000) ;Allow Time to See Combination

EndFunc
Link to comment
Share on other sites

I just now realized what this is looking like and I apologize in advance. I am in no means attempting to make some sort of keygen or something along those lines. I was playing a game where a user would constantly have to ask "PKR" or "PKRAW" (P2P, Kik, Rev, Auto, Watch) and thought to myself what word could I come up with using those letters that would look natural in the english language. I then thought "well hell might as well use my love for AutoIt to figure it out for me". I know I have a unique thought process haha.

Link to comment
Share on other sites

Sorry, but the forum frowns upon game automation discussions. I realise that you are not trying to automate a game, but you are trying to cheat in a game which also, is not to be discussed in a forum. Unfortunately for you, I had almost submitted the answer and then I remembered playing text twist trying to figure out a problem with flash.

Just a hint - if you want to cheat in games, find another forum. Otherwise, dont try and discuss cheating.

Link to comment
Share on other sites

Sorry, but the forum frowns upon game automation discussions. I realise that you are not trying to automate a game, but you are trying to cheat in a game which also, is not to be discussed in a forum. Unfortunately for you, I had almost submitted the answer and then I remembered playing text twist trying to figure out a problem with flash.

Just a hint - if you want to cheat in games, find another forum. Otherwise, dont try and discuss cheating.

I definatly understand.

I'm not trying to do anything directly with this game which is Habbo Hotel http://www.habbohotel.com. I just became curious with the combination possibilities and have been looking for different ideas to use AutoIt. If I were and I am not saying I am trying use this in some sort of way in this game the most I could do is spam in the chat. In all honesty if I were to work on something to manipulate a game in any way it would be in secret and I would not give anyone the opportunity to become an accessory to this. Again I do apologize for what this looks like but please believe me it is only a personal interest and another way to work on my skills in programming AutoIt.

If you have any doubt my username is Pickpocketz in game and feel free to report me if you believe I am not playing with integrity.

Link to comment
Share on other sites

I just now realized what this is looking like and I apologize in advance. I am in no means attempting to make some sort of keygen or something along those lines. I was playing a game where a user would constantly have to ask "PKR" or "PKRAW" (P2P, Kik, Rev, Auto, Watch) and thought to myself what word could I come up with using those letters that would look natural in the english language. I then thought "well hell might as well use my love for AutoIt to figure it out for me". I know I have a unique thought process haha.

You're digging a hole for yourself here. Anyway I believe you. The function _ArrayCombinations should do the job.

Link to comment
Share on other sites

You're digging a hole for yourself here. Anyway I believe you. The function _ArrayCombinations should do the job.

I mean I don't know how to justify myself otherwise... The language has the ability to do so and if that were my interest I wouldn't be so naive as to ask for help on scripting something technically illegal. I don't know what to say except thank you for the help you actually are the only one that gave me advice on my first post (This being the second one.)

Link to comment
Share on other sites

@ PickPocketz You don't have to justify everything. The question you asked is a very general one about something mathematical. Just stick to the question. If there's anything suspicious about a person's post then people will ask what the script is for. As I see it, you have always asked acceptable questions which don't break any forum rules.

Edited by czardas
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

×
×
  • Create New...