Jump to content
Sign in to follow this  
PickPocketz

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.)

Share this post


Link to post
Share on other sites

Your mathematical calculations about how many combinations you would have is incorrect.

Look up Recursive Functions. Might leave a reply later with something I can come up with.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Ok, well then if that is the case and this is about trivial knowledge and not cheating, then that's alright.

I would expect it would be just a basic for loop inside a for loop, hopefully.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Vikramjeet
      include-once #include <File.au3> #include <Excel.au3> #include <String.au3> #include <MsgBoxConstants.au3> Local $file = "TEST.log" FileOpen($file, 0) $TTLPax = 1 For $i = _FileCountLines($file) - $TTLPax to _FileCountLines($file) $line = FileReadLine($file, $i) Global $TktNo = StringMid($line, 8, 13) ; reads 13 characters from $Line starting from the 8th character msgbox(0,'',$TktNo) ; This is just for me to debug For $NoOfPax = 1 to 2 local $TTLSeg = 2 msgbox(0,'',$TTLSeg) msgbox(0,'',"7ABC"& $TktNo &"'N"& $NoOfPax &".1'C1,2'S1,2'B") ; This makes 7ABC1234567890123'N1.1'C1,2'S1,2'B ;But in the next loop I want the value to be 7ABC1234567890333'N2.1'C1,2'S1,2'B Next ExitLoop Next *TEST
      JAMES BAKER
        1.NYC-23JAN
        2.TJ 1234567890123
        3.TJ 1234567890333
      I am reading a file with last 5 lines as above. I want to be able to loop through and pick the values as follows
      1- Pick 1234567890123
      2- Use it to build a format with N1.1
      3- Pick 1234567890333
      2- Use it to build a format with N2.1
      Need help with the loop. Thank You
       
       
    • By Vikramjeet
      For $A1 = 12 To 11 + $Total For $B1 = 1 To ($oExcel.Application.Cells($A1,6).Value) ; This value is from the Excel file. It can be from 1 - 9. For $N1 = 7 To ??? ; This is based on the value of $B1 ((1 = 7, 2 = 17, 3 = 27, 4 = 37, 5 = 47) Send("-"& ($oExcel.Application.Cells($A1,$N1).Value) &"/"& ($oExcel.Application.Cells($A1,$N1+1).Value)) Sleep(400) Send("{ENTER}") Sleep(700) Next Next Next I am not able to figure how to loop $N1 as follows
      If the Value of $B1 = 1 then $N1 = 7
      If the Value of $B1 = 2 then $N1 = 17
      If the Value of $B1 = 3 then $N1 = 27
      If the Value of $B1 = 4 then $N1 = 37  
      The value of $N1 comes from $B1 where 1 = 7, 2 = 17, 3 = 27, 4 = 37, 5 = 47)
      Thank You
    • By ssah8
      So im creating a bot that logs in on a website. The website got a dropdown menu, and I have to choose the right one to login (Student)
      #include <IE.au3>
      #inculude <Inet.au3>
      $oIE = _IECreate("<snip>")
      $Name = _IEGetObjByName($oIE, "ssusername")
      $Pass = _IEGetObjByName($oIE, "sspassword")
      $dropdown = _IEGetObjByName($oIE, "usertype")
      _IEPropertySet($Name, 'innerText', 'censored')
      _IEPropertySet($Pass, 'innerText', 'censored')
      _IEPropertySet($dropdown, 'innerText', 'Student') <------ How do I make the dropdown list select "Student"?
       
       
    • By ThePoro
      Hi everyone.
      I want to ask about this : 
      I want it runs from 1 to 100 and It opens 10 firefox profiles then access youtube. After I close a firefox window, the loop runs and wait for another window close until loop ends
      I have a loop like this.
      Func launch() Local $from = Int(GUICtrlRead($input1)) Local $to = Int(GUICtrlRead($input2)) If $to <> "" Then While $from <= $to Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") $to=$to+1 WEnd Else Local $profile = $to _RunDos("start firefox.exe -p " & $profile & " -no-remote youtube.com") EndIf EndFunc Is there any solution?
      Thank you!
    • By Rhidlor
      First off, the project I'm working on revolves around AS/400 "Client Access software", it's foundation is directly influenced by the thread linked at the bottom of this post. Moving on, to explain the problem I'm facing; my project utilizes an infinite While loop and automatically performs semi-hard coded monotonous tasks to save users time and effort, the problem is, occasionally and unexpectedly "Display Messages" will popup and the core script will continue executing instead of dismissing said message and the script "breaks". As a countermeasure I've added some code to the While loop in an effort to intervene and dismiss these display messages before the core script has a chance to do anything... however it doesn't work. I hope I didn't do too bad of a job explaining that. 
      So I think my question is: How can I temporarily "pause" the core script when these messages spontaneously appear?
      The only other solution I thought of would be to check if a display message has appeared before executing every line of code but that obviously isn't very practical.
      Any and all help is greatly appreciated!
      Thanks
       
      ;Loop to keep script running and handle display messages While 1 dismiss_display_messages() Sleep(50) WEnd ;Function to dismiss display messages Func dismiss_display_messages() If $ps.SearchText("Display Messages") Then $ps.SendKeys("[enter]", 8, 1) ;This while loop waits until the display message has disappeared to resume the core script While $ps.SearchText("Display Messages") Sleep(100) WEnd EndIf EndFunc  
       
×
×
  • Create New...