Smurfin Posted July 18, 2016 Author Posted July 18, 2016 (edited) @SadBunny : Oh ok then I won't discuss it further I'll just fix the unknown line to old format. Now how do I fix this line to work with the old Autoit ? SetExtended(($iKeyCode = 0x0D) ? (True) : (False)) There will be more, I'll ask one by one until the script run properly. Pls help. Edited July 18, 2016 by Smurfin
SadBunny Posted July 18, 2016 Posted July 18, 2016 Like I explained a few posts ago, just write out into a full if-then-else-endif structure. If $iKeyCode = 0x0D Then SetExtended(True) Else SetExtended(False) EndIf Try to understand what is happening and why this is equivalent to the shorthand way: (X ? Y : Z) is an expression that returns a certain value. If expression X is true, then Y is returned, else Z is returned. Consider: TakeUmbrella(IsItRaining() ? True : False) If IsItRaining() Then TakeUmbrella(True) Else TakeUmbrella(False) EndIf Roses are FF0000, violets are 0000FF... All my base are belong to you.
Smurfin Posted July 20, 2016 Author Posted July 20, 2016 Ok tq I'll try it myself for the next ones, I'll ask again if I get it wrong.
Smurfin Posted August 24, 2016 Author Posted August 24, 2016 I just have the time to get back at this, how about this error : >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "K:\AutoIT\LB Sim\GLVEx_Example_1.au3" K:\AutoIT\LB Sim\GLVEx_Example_1.au3 (41) : ==> Error in expression.: Local $aHdrData[][] = [["Col 0", "Col 1", "Col 2"], ["", "", ""], ["", "", "New 1|New 2|New 3"]] Local $aHdrData[^ ERROR >Exit code: 1 Time: 0.310 how's that supposed to be written in old autoit ?
SadBunny Posted August 24, 2016 Posted August 24, 2016 Local $aHdrData[3][3] = [["Col 0", "Col 1", "Col 2"], ["", "", ""], ["", "", "New 1|New 2|New 3"]] Roses are FF0000, violets are 0000FF... All my base are belong to you.
AutoBert Posted August 24, 2016 Posted August 24, 2016 (edited) I would solve the problem like this: expandcollapse popup#include <Array.au3> #include <File.au3> Global $aGifts[100000], $aWeight, $k, $iTotal _FileReadToArray('Gifts.txt', $aWeight, $FRTA_COUNT, '|') ;_ArrayDisplay($aWeight) For $i = 1 To $aWeight[0][0] $iTotal+=$aWeight[$i][1] Next If $iTotal<>100 Then ConsoleWrite('Failure: '&$iTotal&'% check gifts.txt'&@CRLF) Exit EndIf ConsoleWrite($iTotal&'%'&@CRLF) For $i = 1 To $aWeight[0][0] For $j = 1 To $aWeight[$i][1] * 1000 $aGifts[$k] = $aWeight[$i][0] $k += 1 if Not Mod($k,100) Then Sleep(10) Next Next ;_ArrayDisplay($aGifts,'',"40000:100000|1:2") ;_ArrayShuffle($aGifts) ;not realy needed _ArrayColInsert($aWeight,2) $k=0 Do $iUBound=UBound($aGifts) $iRandom=Random(1,$iUBound,1) $iFound=_ArraySearch($aWeight,$aGifts[$iRandom],0,0,0,0,1,0) $aWeight[$iFound][2]+=1 _ArrayDelete($aGifts,$iRandom) Sleep(10) ;$k += 1 ;ConsoleWrite($iUBound&' ') ;if Not Mod($k,50) Then ConsoleWrite(@CRLF) Until $iUBound=1 _ArrayDisplay($aWeight) i used this file: Candy|90 Hamburger|4 Hot Dog|4 Fried Chicken|1 iPhone|0.4 iPad|0.4 Laptop|0.1 Motorcycle|0.07 Car|0.02 Small House|0.009 Big House|0.001 Edited August 24, 2016 by AutoBert
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now