Search results

  1. T

    ASH Map error

    Ok, work week over and time to sit and think straight: After my last post I found another error, which is now fixed: void randomizeList(int[int] input){ int elementCount = count(input); int randNum; int[int] tmpList; if(elementCount<2){ return; } foreach i in input{ tmpList[i] =...
  2. T

    ASH Map error

    Sped it up by changing: for j from randNum to (elementCount-2){ to: for j from randNum to (elementCount-2-i){ So, the final code is: int[int] randomizeList(int[int] masterInput){ int[int] input; foreach i in masterInput{ input[i] = masterInput[i]; } int elementCount =...
  3. T

    ASH Map error

    I caught another situation where an out of bounds was introduced. Below is the fixed version, for anyone interested. I realize now, the (elementCount-i-1) was supposed to be in my random number generation, not the 'j' loop [facepalm]. int[int] randomizeList(int[int] masterInput){ int[int]...
  4. T

    ASH Map error

    Blah. That's what I get for skimming at work. As you point out, when: elementCount=7 (for some reason in my last post I thought it was 6) i=0 for j from randNum to (elementCount-i-1){ becomes: for j from randNum to 6{ and input[j+1] is indeed out of bounds when j=6, and gives a 0. The...
  5. T

    ASH Map error

    'j' can never be 6. It can only be from 0 to 4. That is because of: for i from 0 to (elementCount-2){ 0 to (elementCount -1) just offests everything and treats it like a 0 offset array. 0 to (elementCount -2) ensures that map[j] = map[j+1] is always in bounds; which will never produce a 0...
  6. T

    ASH Map error

    You are correct that with less than two outcomes, philosophically speaking, there is no choice and hence no possibility of randomness. However, in the vein of good programming, I don't want my function to break because someone doesn't adhere to my philosophy. To my knowledge mafia aborts with a...
  7. T

    ASH Map error

    But if you notice, I don't ever 0 anything out. So, the fact that the original contains zeros means that can't be it (all it does is shuffle values around). I'm totally at a loss.
  8. T

    ASH Map error

    For some reason, mafia is destroying the original map. int[int] randomizeList(int[int] input, boolean readout){ int elementCount = count(input); int randNum; int[int] rndList; if(readout){ print("randomize function:","red"); foreach i in input{ print("input["+i+"]...
  9. T

    Feature - Implemented User Input w/ timed default

    I'm not really sure where this thread should go, so I stuck it here. I would like to make a request for: boolean user_confirm(string msg) in the flavor of: boolean user_confirm(string msg, int timer, boolean default) There are instances, when I have sufficient time at night after I get...
  10. T

    CNCS (Custom Non-Combat Script)

    Is there any way to do this? I know you can set choice adventures via the drop-downs, however, I'd like something more robust. For instance, I'd like a way to choose the fudge wasps 3 times and then switch to super-heated fudge ONLY if my remaining turns of Stop and Smell the Fudge (fudge lily...
  11. T

    Buying from the BHH

    mredge73 was absolutely correct. I was missing &howmany= .Digging through the code even more, the very tail end was: <input class=button type=submit value="Buy Item"> <input class=text type=text name=howmany size=2 value=1></center></form> I find it strange though that it didn't appear at the...
  12. T

    Buying from the BHH

    To qualify, I'm not very versed in web page coding. However, I dug through the BHH pane source code and came across: Items for Sale:</b><table><form action=bhh.php method=post><input type=hidden name=action value="buy" ... <input type=radio name=whichitem value=2464 ></td><td><img...
  13. T

    Running Mafia from a flash drive

    Yeah, I just realized how irrelevant my post was. I remember thinking it odd that I didn't need to install Mafia. Oh well, it'll give me an excuse to play with the portable apps suite.
  14. T

    Running Mafia from a flash drive

    I am going to be out of town for a few weeks for work and want to bring Mafia and all my scripts with me and still play KoL. However, I can't install anything on the work laptop. So, I remember hearing about some development going on to write apps that run from flashdrives (like AIM, etc). Does...
  15. T

    Bug - Not A Bug Map_to_file directory problem

    StringReplace(fullFilePath, "..", "?") or something of the like. The ? character is obviously invalid for windows, and will return an error. Why throw sticks in front of their rollerblades like that? [Dave Chappelle] 'Cause f@%! 'em. That's why [/Dave Chappelle]. Seriously though, ".." is a...
  16. T

    Bug - Not A Bug Map_to_file directory problem

    I just logged back in to post this as I just thought of that, but you beat me to it :)
  17. T

    Bug - Not A Bug Map_to_file directory problem

    Also, in thinking, there would be a super simple way to do this. boolean map_to_file( aggregate map_to_save , string file_to_save , boolean compact ) When calling map_to_file, all you have to do is append file_to_save to the mafiaRoot\data\ string and let the OS function call sort it out...
  18. T

    Bug - Not A Bug Map_to_file directory problem

    The issue is creating the subdirectory on the fly if it doesn't exist, but moreover, the ability to create files in the subdirectories. Sometimes I go through and clean house, and I don't want to go back and create a complex directory tree by hand. I had this all scripted in .ash :) Pseudo...
  19. T

    Bug - Not A Bug Map_to_file directory problem

    Ah ok. You could string compare with mafiaroot\data\ and default to mafiaroot\data if not found or len(filename) < len(mafiaRootPath) (or however you want to do it), but, that's on your end if you want to do that or not. Would this be possible to add? Maybe it's better to just leave it at the...
  20. T

    Bug - Not A Bug Map_to_file directory problem

    I really loathe having 90 files in the same directory. I have .ash files that generate files based on character accomplishments, alternate food and booze files, hermit clover history (for giggles), hit rates, drop statistics, etc etc. I had them broken down into organizational directories. I...
Top