Jump to content

Help Plz.. Probley Simple For You But Not Me :(


Recommended Posts

what i need it to do is for it to search the creatures.scp file (its just like an ini file). then get the value in the creatures.scp file for all of the creature maxhealth then multiply or add or subtract or divide by some number a user will set.

well my problem is.. when it searches for the "section" {my $creature} i could not find out how to make it say creature x$ ..

example:
$lookingfor = maxhealth
for $x = 1 to  5
    $creature = $creature + 1
    $var = IniRead("creatures.scp", $creature, $lookingfor, "Value not pressent")
next

output:

[creature 1]
maxhealth=
[creature 2]
  maxhealth=
  [creature 3]
  maxhealth=
  [creature 4]
  maxhealth=
  [creature 5]
  maxhealth=

but this is what i need it to do.. i dont no how to do it. this is my current code, the file i need it to do it to is attached to this post..

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $monstermax, $monstermin, $x

$lookingfor = InputBox ( "WoW Get Value", "Varable name. EX: maxhealth" )
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" )  ; old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
$sign = InputBox ("Math Work", "Whats is the function u want to do?. EX: -  +  *  /   (/ is divide) (* is multiply) (- is subtract) (+ is add)" )
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
For $x = $monstermin to $monstermax step 1
    $creature = $creature + 1
    $var = IniRead("creatures.scp", $creature, $lookingfor, "Value not pressent")
    If $sign = "*" Then
        $total = $numadd * $var
        IniWrite("creatures.scp", $creature, $lookingfor, $total)
    ElseIf $sign = "/" Then
        $total = $numadd / $var
        IniWrite("creatures.scp", $creature, $lookingfor, $total)
    ElseIf $sign = "+" Then
        $total = $numadd + $var
        IniWrite("creatures.scp", $creature, $lookingfor, $total)
    ElseIf $sign = "-" Then
        $total = $numadd - $var
        IniWrite("creatures.scp", $creature, $lookingfor, $total)
    EndIf
Next

thanx for all your help.

Link to comment
Share on other sites

Well, i think this might be what you are looking for. Please read my comments to see what is going on. Also, read up on the IniReadSectionNames function. It proves to be very helpful in cases like these. I also replaced your If then statement with a Select Case statement. Select case statements always look a bit more confusing, but they are 5-8% faster than If then statements.

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $monstermax, $monstermin, $x

$lookingfor = InputBox ( "WoW Get Value", "Varable name. EX: maxhealth" )
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" ) ; old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
$sign = InputBox ("Math Work", "Whats is the function u want to do?. EX: -  +  *  /   (/ is divide) (* is multiply) (- is subtract) (+ is add)" )
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
$sectionnames = IniReadSectionNames("creatures.scp")
; This variable $sectionnames[0] is equal to the total number of sections you have in your INI file
;This is $sectionnames[1] is equal to the first name of the first section in the INI file
;This is $sectionnames[2] is equal to the second name of the second section in the INI file 


;intcount is just being used as a counter

If $monstermax > $sectionnames[0] Then
;this makes sure that it doesn't error in case the person tells it to do too many sections
    $monstermax = $sectionnames[0]
EndIf

For $intcount = $monstermin to $monstermax step 1


;Use this For loop to go to the end of the file
;For $intcount = $monstermin to $sectionnames[0] step 1

;remember, a For loop automatically adds the step value to the variable every loop, in this case it adds 1 to $intcount every loop
    $var = IniRead("creatures.scp",$sectionnames[$intcount], $lookingfor, "Value not pressent")
    Select
        Case $sign = "*"
            $total = $numadd * $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign= "/" 
            $total = $numadd / $var
            IniWrite("creatures.scp", $sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "+"
            $total = $numadd + $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "-" 
            $total = $numadd - $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
    EndSelect
Next

Sorry if there is anything wrong. It is really late here.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

Thanx four your help.. it works great now. but there only one problem and its not with the program its with the creatures.scp file.

when i looked at it good this time to see if it was working when i ran the program. i relized that the creature numbers tend to jump.

ex:

[creature 0]
[creature 1]
[creature 2]
[creature 3]
[creature 4]
[creature 5]
[creature 6]

[creature 30]
[creature 36]
[creature 38]
[creature 40]
[creature 43]
[creature 46]

i took this from the creatures.scp. it seams that it jumps like this the whole file..

problem is when i go to set the max value to stop at.. it seams like the for $x.... next will do the number u want.

ex:

for $sectionnames[$intcount]= 1 to 40 step 1
        $var = IniRead("creatures.scp",$sectionnames[$intcount], $lookingfor, "Value not pressent")
            $total = $numadd + $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
next

the output will be:

[creature 0]
maxhealth=25
[creature 1]
maxhealth=25
[creature 3]
maxhealth=25
[creature 6]
maxhealth=25
[creature 30]
maxhealth=25
[creature 36]
maxhealth=274
[creature 38]
maxhealth=106
[creature 40]
maxhealth=10
[creature 43]
maxhealth=10
[creature 46]
maxhealth=10
[creature 48]
maxhealth=10
[creature 54]
maxhealth=230
[creature 60]
maxhealth=230
[creature 61]
maxhealth=1300
[creature 66]
maxhealth=230
[creature 68]
maxhealth=4931
[creature 69]
maxhealth=73
[creature 74]
maxhealth=230
[creature 78]
maxhealth=123
[creature 79]
maxhealth=745
[creature 80]
maxhealth=83
[creature 89]
maxhealth=5012
[creature 92]
maxhealth=1977
[creature 94]
maxhealth=225
[creature 95]
maxhealth=273
[creature 97]
maxhealth=225
[creature 98]
maxhealth=397
[creature 99]
maxhealth=740
[creature 100]
maxhealth=883
[creature 103]
maxhealth=118
[creature 113]
maxhealth=118
[creature 114]
maxhealth=397
[creature 115]
maxhealth=397
[creature 116]
maxhealth=225
[creature 117]
maxhealth=258
[creature 118]
maxhealth=225
[creature 119]
maxhealth=303
[creature 121]
maxhealth=368
[creature 122]
maxhealth=397
[creature 123]
maxhealth=371

the current code after i tweaked yours alittle bit. (i love your code. thanx for the new comand u told me about)

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $monstermax, $monstermin, $x

$lookingfor = InputBox ( "WoW Get Value", "Varable name. EX: maxhealth" )
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" ); old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
$sign = InputBox ("Math Work", "Whats is the function u want to do?. EX: -  +  *  /   (/ is divide) (* is multiply) (- is subtract) (+ is add)" )
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
$sectionnames = IniReadSectionNames("creatures.scp")

$var2 = $monstermax - $monstermin
If $var2> $sectionnames[0] Then
    $monstermax = $sectionnames[0]
EndIf

For $intcount = $monstermin to $monstermax step 1
    $var = IniRead("creatures.scp",$sectionnames[$intcount], $lookingfor, "Value not pressent")
    Select
        Case $sign = "*"
            $total = $numadd * $var
            IniWrite("creatures.scp ",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign= "/"
            $total = $numadd / $var
            IniWrite("creatures.scp", $sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "+"
            $total = $numadd + $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "-"
            $total = $numadd - $var
            IniWrite("creatures.scp",$sectionnames[$intcount], $lookingfor, $total)
    EndSelect
Next
Link to comment
Share on other sites

So were you able to get it to work correctly? Do you want it so that if the user types in the endng number of creatures, do you want that many sections replaced in the file, or do you want only the sections with the creature numbers up to that number replaced?

Ex:

User inputs starting number as 1 and ending number as five; the first five are replaced

[creature 0]
[creature 1]
[creature 2]
[creature 3]
[creature 4]

Second way

User inputs starting number as 1 and ending number as five;the creatures that have numbers between them in their name inclusive are replaced

[creature 1]
[creature 2]
[creature 3]
[creature 4]
[creature 5]

Which is the one that you want?

I hope that made sense.

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

well.. ive been working on it to start to make the program fool proof..

i only have one problem now and i dont no how to fix it.

when i run the program it and it get to the for x = part were it does the math function if on x= 6 there is no [creature 24] (in the crature file) if will skip [creature 24] and go to the next creature still on x = 6. the problem with this is if you put in for x = 1 to 40 there is no creatures from the 20 to 29. this causes the for x to jump the max that a user sets.

if u can help me plz leave info.

Current code:

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $Signb, $monstermax, $monstermin, $x
Do
    $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?                            1 = maxhealth                2 = faction               3 = level                          4 = money                 5 = size                            6 = type                  7 = maxmana                  8 = damage            9 = speed                     10 = other")
        Select
            Case $lookingfor = 1
                $lookingfor = "maxhealth"
            Case $lookingfor = 2
                $lookingfor = "faction"
            Case $lookingfor = 3
                $lookingfor = "level"
            Case $lookingfor = 4
                $lookingfor = "money"
            Case $lookingfor = 5
                $lookingfor = "size"
            Case $lookingfor = 6
                $lookingfor = "type"
            Case $lookingfor = 7
                $lookingfor = "maxmana"
            Case $lookingfor = 8
                $lookingfor = "damage"
            Case $lookingfor = 9
                $lookingfor = "speed"
            Case $lookingfor = 10
                $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?  EX: maxhealth" )
        EndSelect
Until $lookingfor <> ""
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" ); old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
Do
    $sign = InputBox ("Math Work", "Whats is the function u want to do?               1 = divide                                                           2 = multiply                                                     3 = subtract                                                       4 = add" )
    Select
        case $sign = 1
            $sign = "/"
        case $sign = 2
            $sign = "*"
        case $sign = 3
            $sign = "-"
        case $sign = 4
            $sign = "+"
    EndSelect
Until $sign <> ""
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
$sectionnames = IniReadSectionNames("creatures.scp")

$var2 = $monstermax - $monstermin
If $var2> $sectionnames[0] Then
    $monstermax = $sectionnames[0]
EndIf

For $intcount = $monstermin to $monstermax step 1
    $var = IniRead("creatures.scp",$sectionnames[$intcount], $lookingfor, "Value not pressent")
    Select
        Case $sign = "*"
            $total = $numadd * $var
            IniWrite("creatur2es.scp ",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign= "/"
            $total = $numadd / $var
            IniWrite("creatur2es.scp", $sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "+"
            $total = $numadd + $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "-"
            $total = $numadd - $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
    EndSelect
Next 
SplashTextOn("Title", "Made by: Ray Smith                                                               Contact me with any sugestions or commments.             E-Mail:  MasterGolbez37@gmail.com", 460, 75, -1, -1, 1, "", 15)
Sleep(2000)
SplashOff()
Edited by Golbez
Link to comment
Share on other sites

1

stop using inputboxes and create a nice looking GUI

in SciTE... there are two GUI Builder and Koda(Form Designer)

2

Use the gui to help get the count/selection.. maybe a combo box with a drop-down list or a second gui with checkboxes or ???

3

your user can input the minimum and maximum.. i dont see how this is going to work with the ini you have now

8)

NEWHeader1.png

Link to comment
Share on other sites

i told you there is a problem with the user input and the way the ini is setup...

but, you could put a second counter in... just an idea

$intcount = $monstermax - $monstermin

$Monstercount = ""

for $x = 1 to 123; 123 is the last creature i see in the ini file

$var = IniRead("creatures.scp",$sectionnames[$intcount], $lookingfor, "Value not pressent")

if $var = "Value not pressent" then continueLoop

$Monstercount = $monstercount +1

if $monstercount = $intcount then exitloop

just an idea

8)

NEWHeader1.png

Link to comment
Share on other sites

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $Signb, $monstermax, $monstermin, $x
Do
    $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?                            1 = maxhealth                2 = faction               3 = level                          4 = money                 5 = size                            6 = type                  7 = maxmana                  8 = damage            9 = speed                     10 = other")
        Select
            Case $lookingfor = 1
                $lookingfor = "maxhealth"
            Case $lookingfor = 2
                $lookingfor = "faction"
            Case $lookingfor = 3
                $lookingfor = "level"
            Case $lookingfor = 4
                $lookingfor = "money"
            Case $lookingfor = 5
                $lookingfor = "size"
            Case $lookingfor = 6
                $lookingfor = "type"
            Case $lookingfor = 7
                $lookingfor = "maxmana"
            Case $lookingfor = 8
                $lookingfor = "damage"
            Case $lookingfor = 9
                $lookingfor = "speed"
            Case $lookingfor = 10
                $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?  EX: maxhealth" )
        EndSelect
Until $lookingfor <> ""
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" ); old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
Do
    $sign = InputBox ("Math Work", "Whats is the function u want to do?               1 = divide                                                           2 = multiply                                                     3 = subtract                                                       4 = add" )
    Select
        case $sign = 1
            $sign = "/"
        case $sign = 2
            $sign = "*"
        case $sign = 3
            $sign = "-"
        case $sign = 4
            $sign = "+"
    EndSelect
Until $sign <> ""
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
$sectionnames = IniReadSectionNames("creatures.scp")

$var2 = $monstermax - $monstermin
If $var2> $sectionnames[0] Then
    $monstermax = $sectionnames[0]
EndIf

$intcount1 = $monstermax - $monstermin
$intcount = ""
For $x = 0 to 4000
    $var = IniRead("creatures.scp",$sectionnames[$x], $lookingfor, "Value not pressent")
    If $var = "Value not pressent" Then ContinueLoop
    $intcount = $intcount + 1
    If $intcount = $intcount1 Then ExitLoop
    Select
        Case $sign = "*"
            $total = $numadd * $var
            IniWrite("creatur2es.scp ",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign= "/"
            $total = $numadd / $var
            IniWrite("creatur2es.scp", $sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "+"
            $total = $numadd + $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "-"
            $total = $numadd - $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
    EndSelect
Next
SplashTextOn("Title", "Made by: Ray Smith                                                               Contact me with any sugestions or commments.             E-Mail:  MasterGolbez37@gmail.com", 460, 75, -1, -1, 1, "", 15)
Sleep(2000)
SplashOff()

8)

NEWHeader1.png

Link to comment
Share on other sites

it still dont work...

when u test it put in:

1 for the what your trying to change (first window)

1 for the staring number (second window)

40 for the ending number (third window)

2 for the function(forth window)

5 for the number (last window)

output is:

[creature 0]
maxhealth=100
[creature 1]
maxhealth=100
[creature 3]
maxhealth=100
[creature 6]
maxhealth=100
[creature 30]
maxhealth=100
[creature 36]
maxhealth=1345
[creature 38]
maxhealth=505
[creature 40]
maxhealth=25
[creature 43]
maxhealth=25
[creature 46]
maxhealth=25
[creature 48]
maxhealth=25
[creature 54]
maxhealth=1125
[creature 60]
maxhealth=1125
[creature 61]
maxhealth=6475
[creature 66]
maxhealth=1125
[creature 68]
maxhealth=24630
[creature 69]
maxhealth=340
[creature 74]
maxhealth=1125
[creature 78]
maxhealth=590
[creature 79]
maxhealth=3700
[creature 80]
maxhealth=390
[creature 89]
maxhealth=25035
[creature 92]
maxhealth=9860
[creature 94]
maxhealth=1100
[creature 95]
maxhealth=1340
[creature 97]
maxhealth=1100
[creature 98]
maxhealth=1960
[creature 99]
maxhealth=3675
[creature 100]
maxhealth=4390
[creature 103]
maxhealth=565
[creature 113]
maxhealth=565
[creature 114]
maxhealth=1960
[creature 115]
maxhealth=1960
[creature 116]
maxhealth=1100
[creature 117]
maxhealth=1265
[creature 118]
maxhealth=1100
[creature 119]
maxhealth=1490
[creature 121]
maxhealth=1815

it should be creature numbers 1 to 40... its not >< it puts in 40 lines of code :think:

Edited by Golbez
Link to comment
Share on other sites

worked for me... i think ( no errors )

[creature 0]
maxhealth=0.0892857142857145
[creature 1]
maxhealth=280
[creature 3]
maxhealth=3355
[creature 6]
maxhealth=210
[creature 30]
maxhealth=625
[creature 36]
maxhealth=1210
[creature 38]
maxhealth=445
[creature 40]
maxhealth=595
[creature 43]
maxhealth=1065
[creature 46]
maxhealth=915
[creature 48]
maxhealth=2850
[creature 54]
maxhealth=1065
[creature 60]
maxhealth=1065
[creature 61]
maxhealth=6415
[creature 66]
maxhealth=1065
[creature 68]
maxhealth=24570
[creature 69]
maxhealth=280
[creature 74]
maxhealth=1065
[creature 78]
maxhealth=530
[creature 79]
maxhealth=3640
[creature 80]
maxhealth=355
[creature 89]
maxhealth=25000
[creature 92]
maxhealth=9825
[creature 94]
maxhealth=1065
[creature 95]
maxhealth=1305
[creature 97]
maxhealth=1065
[creature 98]
maxhealth=1925
[creature 99]
maxhealth=3640
[creature 100]
maxhealth=4355
[creature 103]
maxhealth=530
[creature 113]
maxhealth=530
[creature 114]
maxhealth=1925
[creature 115]
maxhealth=1925
[creature 116]
maxhealth=1065
[creature 117]
maxhealth=1230
[creature 118]
maxhealth=1065
[creature 119]
maxhealth=1455
[creature 121]
maxhealth=1780

I used the same numbers as you... 1, 1, 40, 2, 5

thats the output above

8)

NEWHeader1.png

Link to comment
Share on other sites

1 for the what your trying to change (first window)

1 for the staring number (second window)

40 for the ending number (third window)

2 for the function(forth window)

5 for the number (last window)

your should get:

[creature 0]
maxhealth=100
[creature 1]
maxhealth=100
[creature 3]
maxhealth=100
[creature 6]
maxhealth=100
[creature 30]
maxhealth=100
[creature 36]
maxhealth=1345
[creature 38]
maxhealth=505
[creature 40]
maxhealth=25

if it worked right

Link to comment
Share on other sites

what it shows is

1 = health

1 = starting creature count

40 = ending creature count......... this is 40 for 40 creatures and 40 ini writes

2 = mutliply

5 = (multiply by ) 5

the math you have in the script and the ini write is CORRECT... how it is written

i put this in the script below

MsgBox('', "$intcount= " & $intcount, "$numadd= " & $numadd & @CRLF & "$var= " & $var & @CRLF & "$total= " & $total)

dim $var, $var2, $lookingfor, $numadd, $total, $creature, $sign, $Signb, $monstermax, $monstermin, $x
Do
    $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?                            1 = maxhealth                2 = faction               3 = level                          4 = money                 5 = size                            6 = type                  7 = maxmana                  8 = damage            9 = speed                     10 = other")
        Select
            Case $lookingfor = 1
                $lookingfor = "maxhealth"
            Case $lookingfor = 2
                $lookingfor = "faction"
            Case $lookingfor = 3
                $lookingfor = "level"
            Case $lookingfor = 4
                $lookingfor = "money"
            Case $lookingfor = 5
                $lookingfor = "size"
            Case $lookingfor = 6
                $lookingfor = "type"
            Case $lookingfor = 7
                $lookingfor = "maxmana"
            Case $lookingfor = 8
                $lookingfor = "damage"
            Case $lookingfor = 9
                $lookingfor = "speed"
            Case $lookingfor = 10
                $lookingfor = InputBox ( "WoW Get Value", "Whate are you tring to change?  EX: maxhealth" )
        EndSelect
Until $lookingfor <> ""
;$creature = InputBox ("Creature number", "Whats is the creature number. EX: creature 331" ); old way..
$monstermin = InputBox ( "WoW Get Value", "Starting number of creatures. EX: 1" )
$monstermax = InputBox ( "WoW Get Value", "Endng number of creatures. EX: 20" )
Do
    $sign = InputBox ("Math Work", "Whats is the function u want to do?               1 = divide                                                           2 = multiply                                                     3 = subtract                                                       4 = add" )
    Select
        case $sign = 1
            $sign = "/"
        case $sign = 2
            $sign = "*"
        case $sign = 3
            $sign = "-"
        case $sign = 4
            $sign = "+"
    EndSelect
Until $sign <> ""
$numadd = InputBox ( "WoW Get Value", "number to do math with.  (add,subtract,devide,multiply)" )

$creature = 0
$sectionnames = IniReadSectionNames("creatures.scp")

$var2 = $monstermax - $monstermin
If $var2> $sectionnames[0] Then
    $monstermax = $sectionnames[0]
EndIf

$intcount1 = $monstermax - $monstermin
$intcount = ""
For $x = 0 to 4000
    $var = IniRead("creatures.scp",$sectionnames[$x], $lookingfor, "Value not pressent")
    If $var = "Value not pressent" Then ContinueLoop
    $intcount = $intcount + 1
    If $intcount = $intcount1 Then ExitLoop
    Select
        Case $sign = "*"
            $total = $numadd * $var
            MsgBox('', "$intcount= " & $intcount, "$numadd= " & $numadd & @CRLF & "$var= " & $var & @CRLF & "$total= " & $total)
            IniWrite("creatur2es.scp ",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign= "/"
            $total = $numadd / $var
            IniWrite("creatur2es.scp", $sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "+"
            $total = $numadd + $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
        Case $sign = "-"
            $total = $numadd - $var
            IniWrite("creatur2es.scp",$sectionnames[$intcount], $lookingfor, $total)
    EndSelect
Next
SplashTextOn("Title", "Made by: Ray Smith                                                               Contact me with any sugestions or commments.             E-Mail:  MasterGolbez37@gmail.com", 460, 75, -1, -1, 1, "", 15)
Sleep(2000)
SplashOff()

8)

NEWHeader1.png

Link to comment
Share on other sites

i dont get what your getting at...

i no the for x is working.. when it searchs the creatures.scp file there is not 40 creatures in a row.. it looks like this:

[creature 0]
name=Spawn Point (Only GM can see it)
faction=35
level=255
money=-1
attack=2000 2200
bounding_radius=1.5
combat_reach=2.25
damage=0 2
maxhealth=20
model=262
size=0.5
type=1
maxmana=0

[creature 1]
name=Spawn Point (Only GM can see it)
faction=35
level=255
money=-1
attack=2000 2200
bounding_radius=1.5
combat_reach=2.25
damage=0 2
maxhealth=20
model=262
size=0.5
type=1
maxmana=0

[creature 3]
name=Flesh Eater
faction=21
level=24..25
money=45..104
attack=1710 1881
bounding_radius=0.8
combat_reach=2.25
damage=39 55
loottemplate=3
maxhealth=20
model=987
speed=1.08
type=6
maxmana=0

[creature 6]
name=Kobold Vermin
flags1=080000
faction=32
level=1
money=1..2
attack=2000 2200
bounding_radius=0.693
//civilian=1
combat_reach=2.25
damage=0 2
equipmodel=0 5010 2 10 2 17 2 0 0 0
loottemplate=6
maxhealth=20
model=10913
size=0.7
speed=0.63
type=7
maxmana=0

[creature 30]
name=Forest Spider
aiscript=ForestSpider
flags1=010
faction=22
level=5..6
money=-1
attack=1950 2145
bounding_radius=0.41
combat_reach=2.25
damage=5 7
family=3
loottemplate=30
maxhealth=20
maxmana=142
model=382
size=0.42
speed=0.39
type=1

[creature 36]
name=Harvest Golem
aiscript=HarvestGolem
faction=14
level=11..12
money=11..29
attack=1810 1991
bounding_radius=1.195
combat_reach=2.25
damage=22 32
family=9
loottemplate=36
maxhealth=269
maxmana=100
model=367
size=0.85
speed=0.87
type=9

[creature 38]
name=Defias Thug
flags1=080000
faction=17
level=3..4
money=3..7
attack=1970 2167
bounding_radius=0.312
combat_reach=2.25
damage=4 5
equipmodel=0 7487 2 7 1 13 3 0 0 0
loottemplate=38
maxhealth=101
model=5035
model1=5036
speed=0.92
type=7
maxmana=0

[creature 40]
name=Kobold Miner
aiscript=Koboldminer
flags1=080000
faction=26
level=6..7
money=6..14
attack=1910 2101
bounding_radius=1.139
combat_reach=2.25
damage=9 14
equipmodel=0 7493 2 0 1 13 3 0 0 0
loottemplate=40
maxhealth=5
maxmana=54
model=373
size=1.15
speed=1.10
type=7

if u can tell there is missing creatures.. i need it to skip over the creatures that are missing indead of just going on to the next creature

this is the program..

[creature 0]
maxhealth=100
[creature 1]
maxhealth=100
[creature 3]
maxhealth=100
[creature 6]
maxhealth=100
[creature 30]
maxhealth=100
[creature 36]
maxhealth=1345
[creature 38]
maxhealth=505
[creature 40]
maxhealth=25
Edited by Golbez
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...