Jump to content

Fun little project...


Recommended Posts

The idea is this; I have 140 points to spend and I want to find ALL the possible combinations across 5 attributes. According to my pencil math the very first combination should be; 12 8 2 1 1. However my brain is not working hard enough to figure this out... If you run this you will get the first 3 combo which is 12 8 3 leaving me 2 numbers short of the first combo. So this much I figured out I need to jump back removing the last value and recompute. But can some math wiz out there come up with an easier method? This is for computing game stats and in no way violates any EULA.

Thanks!

#include <GuiConstants.au3>
#NoTrayIcon
$Total_points = InputBox ("Attribute Points","Total Points:")
$Division = InputBox ("Division","How many skills?")
$Attributes = ""
$Dv = $Division
;While $Dv > 0
$Dv = $Division
$Tp = $Total_points
While $Tp > 0
$Tv = $Tp
If $Tp > 96 Then
  $Attributes = $Attributes & "12 "
  $Tp -= 97
  $Dv -= 1
ElseIf  $Tp > 76 Then
  $Attributes = $Attributes & "11 "
  $Tp -= 77
  $Dv -= 1
ElseIf $Tp > 60 Then
  $Attributes = $Attributes & "10 "
  $Tp -= 61
  $Dv -= 1
ElseIf $Tp > 47 Then
  $Attributes = $Attributes & "9 "
  $Tp -= 48
  $Dv -= 1
ElseIf $Tp > 36 Then
  $Attributes = $Attributes & "8 "
  $Tp -= 37
  $Dv -= 1
ElseIf $Tp > 27 Then
  $Attributes = $Attributes & "7 "
  $Tp -= 28
  $Dv -= 1
ElseIf $Tp > 20 Then
  $Attributes = $Attributes & "6 "
  $Tp -= 21
  $Dv -= 1
ElseIf $Tp > 14 Then
  $Attributes = $Attributes & "5 "
  $Tp -= 15
  $Dv -= 1
ElseIf $Tp > 9 Then
  $Attributes = $Attributes & "4 "
  $Tp -= 10
  $Dv -= 1
ElseIf $Tp > 5 Then
  $Attributes = $Attributes & "3 "
  $Tp -= 6
  $Dv -= 1
ElseIf $Tp > 2 Then
  $Attributes = $Attributes & "2 "
  $Tp -= 3
  $Dv -= 1
ElseIf $Tp > 0 Then
  $Attributes = $Attributes & "1 "
  $Tp -= 1
  $Dv -= 1
EndIf
WEnd
If $Dv > 0 Then
MsgBox (0,"Last value before exit", $Tv)
EndIf
MsgBox (0,"Attribute List", $Attributes)
;WEnd
Link to comment
Share on other sites

This has been done before in someone elses homework.

I'm sorry but I cannot help with a link as I have no Idea what it might be found under.

Something to do with apples and bananas if I recall.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Thank you. While that wasn't hard to find -just typed apples and bananas in the search bar- it is not that simple of a math problem.

In the game you are given points to spend each time your character levels up. Depending on the character build you could have many skills to spend these points on but most likely you won't be spreading them out too much. If you have 140 points to spend on 5 different skills you don't want to enter any zeros. So according to the cost the first combination should be; 12 8 2 1 1 which is 139 points spent. The program needs to reduce certain values as it recomputes the permutations;

12 7 4 2 1

12 6 4 4 1

etc.

But here is a more current code that I am working on.

#include <GuiConstants.au3>
#Include <Array.au3>
#NoTrayIcon
$Total_points = InputBox ("Attribute Points","Total Points:")
$Division = InputBox ("Division","How many skills?")
Dim $At [$Division]
$Division -= 1
For $i = 0 To $Division
$At[$i] = 0
Next
$Dv = 0
$Tp = $Total_points
While $Dv < $Division + 1
$Tv = $Tp
Get_Attrib ()
If $Tp < 1 Then
  $Tp = $Tv
  $At[$Dv] -= 1
EndIf
$Dv += 1
WEnd
$Tp = 0
For $i = 0 To $Division
If $At[$i] = 12 Then $Tp += 97
If $At[$i] = 11 Then $Tp += 77
If $At[$i] = 10 Then $Tp += 61
If $At[$i] = 9 Then $Tp += 48
If $At[$i] = 8 Then $Tp += 37
If $At[$i] = 7 Then $Tp += 28
If $At[$i] = 6 Then $Tp += 21
If $At[$i] = 5 Then $Tp += 15
If $At[$i] = 4 Then $Tp += 10
If $At[$i] = 3 Then $Tp += 6
If $At[$i] = 2 Then $Tp += 3
If $At[$i] = 1 Then $Tp += 1
Next
$Attributes = ""
For $i = 0 To $Division
$Attributes = $Attributes & " " & $At[$i]
Next
MsgBox (0,"Attribute List", $Attributes & " Points:" & $Tp)
Func Get_Attrib ()
If $Tp > 96 Then
  $At[$Dv] = 12
  $Tp -= 97
  $Tv -= 77
ElseIf  $Tp > 76 Then
  $At[$Dv] = 11
  $Tp -= 77
  $Tv -= 61
ElseIf $Tp > 60 Then
  $At[$Dv] = 10
  $Tp -= 61
  $Tv -= 48
ElseIf $Tp > 47 Then
  $At[$Dv] =  9
  $Tp -= 48
  $Tv -= 37
ElseIf $Tp > 36 Then
  $At[$Dv] =  8
  $Tp -= 37
  $Tv -= 28
ElseIf $Tp > 27 Then
  $At[$Dv] =  7
  $Tp -= 28
  $Tv -= 21
ElseIf $Tp > 20 Then
  $At[$Dv] =  6
  $Tp -= 21
  $Tv -= 15
ElseIf $Tp > 14 Then
  $At[$Dv] =  5
  $Tp -= 15
  $Tv -= 10
ElseIf $Tp > 9 Then
  $At[$Dv] =  4
  $Tp -= 10
  $Tv -= 6
ElseIf $Tp > 5 Then
  $At[$Dv] =  3
  $Tp -= 6
  $Tv -= 3
ElseIf $Tp > 2 Then
  $At[$Dv] =  2
  $Tp -= 3
  $Tv -= 1
ElseIf $Tp > 0 Then
  $At[$Dv] =  1
  $Tp -= 1
EndIf
EndFunc
Link to comment
Share on other sites

See if you can figure this simple math problem.

from forum rules

Do not discuss automating games here.

+

from your post

In the game you are given points to spend each time your character levels up

=

?

EDIT:

multiple choice

a: a flood of people helping you with game bot

b: a locked thread

c: banana

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

This kind of comment really cheese me off to no end. This doesn't automate a game! It not a bot I thought this place was here to assist people not accuse people. I stated it does not violate any EULA and it is nothing more than a calculator for attributes.

The people on this forum are freaking brain dead, Screw this, I am out of here.

Link to comment
Share on other sites

Not all are brain dead, just some of us.

But even with my dead brain I know, that 'discussing game automation' goes against the rule

of 'no game automation discussion'.

Sorry I'm not bright enough for you professor.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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