• Edited 3 times, last by Brad Innes: improving code. ().

    • Official Post

    maybe you should explain what a player need to enter there that your script get a right result :)
    (also only one language (english) is supported) ...


    ps:

    Quote


    if(DataArray.trim() === "")


    should be


    Quote


    if(DataArray[i].trim() === "")

  • Sorry but i need to ask:


    Why that one:

    JavaScript
    if(DataArray.trim() === "")
    {
    }
    else
    {
        DataArray[i]=DataArray[i].replace(".","");
        DataArray[i]=DataArray[i].replace(".","");
        Total_Resources += parseInt(DataArray[i],0);
    }


    An empty if, let me guess 30 seconds code :P



    Good to see you still do stuff like that :)

  • yeah its been a long time since i have done anything for the public of SI... i forget about how humans do things...


    the code is looking for a copy of the planet data you are wishing to recyle EX: (mods forgive me i know this breaks the rules.)

    Quote

    [01:09:12 ] - Syjon Owner Investigator Zigix91 Send message Points 70.663.203 Position 01:09:12 Temperature -5 °C Alliance Soldiers of Death Status Strong Space rubble Pig iron 391.518 Metal 323.630 Kryptonite 290.526 Spice 188.814 Info | plan Close

    just select the whole box copy and paste into the window... and press click... the converter should pop up a winow and the first number is the total amount of resources to be collected... just in case your wondering... the next number is the total amount of recylers you need rounded up to you know exactly how many to send...



    @
    Dschibait


    good catch... code still works as written for some reason... ill reload my code on my machien and see if i didn't acidentally send the world an older version from when i was still debugging...



    @


    -Sarkasmus-




    im a lazy old programmer i didn't want to look up how to detect a null and if not null run my math so i just shortened the equation lol... super lazy brad activate


    im going back to check my code... i wrote this real quick and i know it works on my computer but im concerned with my typo.... i don't make many of those but they do bother me when i do and things still work lol....

  • hey shark open my original post for editing and check the code that line that
    Dschibait


    says is incorrect is correct in the quote but doesn't display as correct on the forum... it only display correctly in edit mode... andy ideas?


    i might need to go just publish this on a website but i don't have my own server so would be a total pain...

  • also don't encourage me... lord knows how much i hate how my alliance gathered intel and have been really really tempted to go rebuild my old toys... not sure if im going to make much improvements but i am sure i can do a bit better job on the design time now that i know a lot of things i did not the first time around...


    for those that don't remember the dawn of time... i used to be able to type in a name and my server would print me out a detailed report with all the planet locations and a rough break down of the players points... their current tech.. known and estimated fleet size and makeup... notes from my fellow hunters on when we thought they were online and any useful data about that player we felt like sharing... i was working on astro range and activity warnings...and a particle cannon application before i retired... so much time poured into this game...



    so in short a spread sheet with some numbers on it is not intel.... lol... and don't tempt me lol... old age makes you ramble lol...