Discussion in 'Script Releases' started by Booyah, Oct 13, 2011.

  1. Booyah

    Booyah Member

    Messages:
    9
    Heyas,

    Here's my version of the Local Monitor script.

    I tried the other one here last night and it didn't quite work the way I wanted (cheers for the idea though :) ) so I quickly put this together last night and this arvo.

    Tested it out all evening, no probs, works great.

    This one works on standings rather than a white list, and tracks individual pilots as they enter and leave the system.

    Doesn't autowarp anywhere, just makes a sound and flashes an alert texture I quickly made up on the screen. It's all fully configurable though.

    All instrustions are in the locmon.iss file.

    If you have any idea/suggestion/feedback or find a bug, please let me know.

    Cheers.

    Attached Files:

  2. CyberTech

    CyberTech Second-in-Command Staff Member

    Messages:
    376
    Good code.
  3. thul

    thul Member

    Messages:
    4
    It keeps beeping for me when a blue comes in my system... even on my own corp members... so im not sure if this works properly? it doesnt seem to work using personal standings either
  4. Booyah

    Booyah Member

    Messages:
    9
    Tested it all out tonight and zero problems. It's weird it's not working for you.

    What's it saying in the Inner Space console as people enter and depart the system you're in?
  5. thul

    thul Member

    Messages:
    4
    It just kept saying a hostile entered/left system for everyone. When i first start it prints a list of hostiles, my own character is among those too.

    Also it doesnt work on Isxeve beta :( i'll see if i have time/motivation to port it
  6. thul

    thul Member

    Messages:
    4
    I figured out the problem, the script only used standing. If a person came into your system that is in your alliance and your corp has no standing towards the alliance (why should it, its your alliance) it would flag them as hostile.

    I'v fixed this issue and made the script able to work using ISXEVE Beta.

    You will still need the files in the .zip of the first post for this to work properly!

    Code (Text):

    /*
     | Locmon v0.1 - 20111013 - ISXEVE Beta
     |
     | Description:
     | Monitors local and plays a sound (optional) or
     | flashes an alert on screen (optional) when a
     | hostile enters local.
     |
     | A friendly is a pilot with:
     |   - An AllianceToAlliance standing of > 0
     |   - A CorpToAlliance standing of > 0
     |   - A MeToPilot standing of > 0
     |
     | Installation:
     | 1) Copy locmon.iss to the \Innerspace\Scripts\ directory
     | 2) Copy alarm.wav to the \Innerspace\Scripts\ directory
     | 3) Copy alarm.png to the \Innerspace\Interface\ directory
     |
     | Configuration:
     | 1) Locate the Configuration section of the script
     | 2) Adjust to your liking
     |
     | Running:
     |    - Simply enter: run locmon into the Innerspace console
     |
     | Terminating:
     |    - Enter: ExitLocmon:Set[1] into the Innerspace console
     |    - This will clean up the interface window upon exit
    */

    variable(global) bool ExitLocmon

    function main()
    {
        /* Declare Variables */
        variable iterator pilotIterator
       
        variable index:pilot pilotIndex
       
        variable set friendlySet
        variable set hostileSet
        variable set pilotSet
        variable set friendlyCleanupSet
        variable set hostileCleanupSet
       
        variable int loopDelay
        variable int loopCount
        variable int alertX
        variable int alertY

        variable bool isFriendly
        variable bool newHostile
        variable bool showInitMessages
        variable bool showEnterMessages
        variable bool showLeaveMessages
        variable bool showAlertText
        variable bool playAlertSound
       
        variable string alertFile
        variable string timeStamp
       
        /*----------------+
         |  Configuration |
         +----------------*/
        echo "Starting up";
        loopDelay:Set[10]           /* Set main loop delay */
        showInitMessages:Set[1]     /* Display initialisation messages in the console */
        showEnterMessages:Set[1]    /* Show a message when a pilot enters local */
        showLeaveMessages:Set[1]    /* Show a message when a pilow leaves local */
        showAlertText:Set[1]        /* Flash ! Alert ! on the screen when a pilot enters local */
        playAlertSound:Set[1]       /* Play an alarm sound when a pilot enters local */
        alertFile:Set["alarm.wav"]  /* Name of sound file to play for alert */
       
        /* End Configuration */

        /* Initialise alert window */
        alertX:Set[${Math.Calc[(${Display.Width}\\2)-248].Int}]
        alertY:Set[${Math.Calc[(${Display.Height}\\2)-52].Int}]
        UIElement[screen]:AddChild[Frame,locmon_window,<Frame Name='locmon_window'><X>${alertX}</X><Y>${alertY}</Y><Border>0</Border><Width>496</Width><Height>105</Height><Background>0</Background><Texture Filename='alert.png' ColorKey='ff000000' /></Frame>]
        UIElement[locmon_window]:Hide

        /* Set global variable to force main loop to run */
        ExitLocmon:Set[FALSE]
       
        /* Get a list of pilots in local */
        EVE:GetLocalPilots[pilotIndex]     

        /* Loop through pilots to populate initial sets */
        pilotIndex:GetIterator[pilotIterator]
        if ${pilotIterator:First(exists)}
        {
            do
            {
                /* Assume pilot is hostile */
                isFriendly:Set[FALSE]
               
                /* If pilot is friendly, flag as friendly */
                if ((${pilotIterator.Value.Standing.AllianceToAlliance} > 0) || (${pilotIterator.Value.Standing.CorpToAlliance} > 0) || (${pilotIterator.Value.AllianceID} == ${Me.AllianceID}) || (${pilotIterator.Value.Corp.ID} == ${Me.Corp.ID}))
                    isFriendly:Set[TRUE]
               
                /* Determine if pilot is hostile based on personal standings */
                if ${pilotIterator.Value.Standing.MeToPilot} < 0
                    isFriendly:Set[FALSE]
                   
                /* Add pilot to appropriate set */
                if ${isFriendly}
                {
                    friendlySet:Add["${pilotIterator.Value.Name}"]
                   
                    if ${showInitMessages}
                        echo "Friendly identified: " ${pilotIterator.Value.Name}
                }
                else
                {
                    hostileSet:Add["${pilotIterator.Value.Name}"]
                   
                    if ${showInitMessages}
                        echo "Hostile identified: " ${pilotIterator.Value.Name}
                }
            }
            while ${pilotIterator:Next(exists)}
        }
       
        /* Wait before commencing main loop */
        wait ${loopDelay}
        echo "Started monitoring local"
        /* Main Loop */
        do
        {
            /* Get Time stamp */
            timeStamp:Set[${Time.Date} ${Time.Time24}]
           
            /* Clean up variables */
            pilotIndex:Clear
            pilotSet:Clear
            friendlyCleanupSet:Clear
            hostileCleanupSet:Clear
            newHostile:Set[FALSE]
           
            /* Get a list of pilots in local */
            EVE:GetLocalPilots[pilotIndex]
           
            /* Loop through pilots to determine additions */
            pilotIndex:GetIterator[pilotIterator]
            if ${pilotIterator:First(exists)}
            {
                do
                {
                    /* Assume pilot is hostile */
                    isFriendly:Set[FALSE]
                   
                    /* Determine if pilot is friendly */
                    if ((${pilotIterator.Value.Standing.AllianceToAlliance} > 0) || (${pilotIterator.Value.Standing.CorpToAlliance} > 0) || (${pilotIterator.Value.AllianceID} == ${Me.AllianceID}) || (${pilotIterator.Value.Corp.ID} == ${Me.Corp.ID}))
                        isFriendly:Set[TRUE]
                   
                    /* Determine if pilot is hostile based on personal standings */
                    if ${pilotIterator.Value.Standing.MeToPilot} < 0
                        isFriendly:Set[FALSE]
                       
                    if ${pilotIterator.Value.AllianceID} == ${Me.AllianceID}
                        isFriendly:Set[TRUE]

                    /* If pilot is friendly */
                    if ${isFriendly}
                    {
                        /* If pilot is new to local, add to friendly set */
                        if !${friendlySet.Contains["${pilotIterator.Value.Name}"]}
                        {
                            friendlySet:Add["${pilotIterator.Value.Name}"]

                            if ${showEnterMessages}
                                echo ${timeStamp} "Friendly entered system ( " ${pilotIterator.Value.Name} " )"
                        }
                    }
                    else /* Pilot is hostile */
                    {
                        /* If pilot is new to local, add to hostile set */
                        if !${hostileSet.Contains["${pilotIterator.Value.Name}"]}
                        {
                            hostileSet:Add["${pilotIterator.Value.Name}"]
                            newHostile:Set[TRUE]

                            if ${showEnterMessages}
                                echo ${timeStamp} "Hostile entered system ( " ${pilotIterator.Value.Name} " )"
                        }
                    }

                    /* Add pilot to pilot set for reverse verify*/
                    pilotSet:Add["${pilotIterator.Value.Name}"]
                }
                while ${pilotIterator:Next(exists)}

                /* Make a list of friendlies who have left system */
                friendlySet:GetIterator[pilotIterator]
                if ${pilotIterator:First(exists)}
                {
                    do
                    {
                        if !${pilotSet.Contains["${pilotIterator.Value}"]}
                        {
                            friendlyCleanupSet:Add["${pilotIterator.Value}"]

                            if ${showLeaveMessages}
                                echo ${timeStamp} "Friendly left system ( " ${pilotIterator.Value} " )"
                        }
                    }
                    while ${pilotIterator:Next(exists)}        
                }
               
                /* Remove departed friendlies from friendly set */
                friendlyCleanupSet:GetIterator[pilotIterator]
                if ${pilotIterator:First(exists)}
                {
                    do
                    {
                        friendlySet:Remove["${pilotIterator.Value}"]
                    }
                    while ${pilotIterator:Next(exists)}        
                }          
               
                /* Make a list of hostiles who have left system */
                hostileSet:GetIterator[pilotIterator]
                if ${pilotIterator:First(exists)}
                {
                    do
                    {
                        if !${pilotSet.Contains["${pilotIterator.Value}"]}
                        {
                            hostileCleanupSet:Add["${pilotIterator.Value}"]

                            if ${showLeaveMessages}
                                echo ${timeStamp} "Hostile left system ( " ${pilotIterator.Value} " )"
                        }
                    }
                    while ${pilotIterator:Next(exists)}        
                }
               
                /* Remove departed hostiles from hostile set */
                hostileCleanupSet:GetIterator[pilotIterator]
                if ${pilotIterator:First(exists)}
                {
                    do
                    {
                        hostileSet:Remove["${pilotIterator.Value}"]
                    }
                    while ${pilotIterator:Next(exists)}        
                }          
            }

            /* Flash Alert on screen */
            if ${newHostile}
            {
                if ${playAlertSound}
                    PlaySound ${alertFile}

                if ${showAlertText}
                {
                    for (loopCount:Set[0] ; ${loopCount}<4 ; loopCount:Inc)
                    {
                        UIElement[locmon_window]:Show
                        wait 4
                        UIElement[locmon_window]:Hide
                        wait 1
                    }
                }
            }
           
            /* Wait 3 seconds for next scan */
            wait ${loopDelay}
        }
        while !${ExitLocmon}
        echo "Exiting LocMon"
        /* Clean Up */
        UIElement[locmon_window]:Destroy
    }
     
  7. SPEC1AL1ST

    SPEC1AL1ST Member

    Messages:
    28
    After crucible 1.1 project dont work.
    RIP?
  8. SPEC1AL1ST

    SPEC1AL1ST Member

    Messages:
    28
  9. thul

    thul Member

    Messages:
    4
    the version i posted works fine with Crucible 1.1 and also doesnt require you to have standings towards your own alliance :)
  10. DragonTail34

    DragonTail34 Member

    Messages:
    4
    Using a neutral alt (NPC Corp), how can I make it so that anything set -5 or -10 to the neutral is hostile, and anything with 0 or above is considered
    friendly?
  11. Booyah

    Booyah Member

    Messages:
    9
    Thanks for updating it :)

    I stopped flying expensive ships for a while, so stopped using it. Back in not-cheap ships again, so using it again now.

    @DragonTail34: Without testing, I think all you'll need to do is assume the pilot is friendly, instead of hostile. Just search for "Assume the pilot is hostile" and change the line underneath each occurrence (there should be 2 of them) to set the variable to TRUE instead of FALSE.

    I'll update the main post soon and put a new zip file there that's up to date.

    Thanks again.
  12. DragonTail34

    DragonTail34 Member

    Messages:
    4
    I tried changing the variables to True, and tested it out a few times, but still can not get it to recognize -5 -10 as hostile.
    I dunno what variables to play with or what to mess with, figured someone here with more knowledge would know.

    also thanks for the script it's still nice for low population/traffic areas now if I could just get it to recognize -5 -10 id be set.
  13. plasmabug

    plasmabug Member

    Messages:
    1
    Any chance of getting this to work after Inferno update?
  14. SPEC1AL1ST

    SPEC1AL1ST Member

    Messages:
    28
    Who can help? Dont work in Inferno.
    All corp members are Hostile :(
  15. Amadeus

    Amadeus The Maestro Staff Member

    Messages:
    8,264
    This script needs to be updated so that it doesn't run/continue until ${ISXEVE.IsReady} is TRUE.

    Actually, the entire script should probably be wrapped by a launcher which checks ${ISXEVE.IsReady}. In other words, rename locmon.iss to locmon_actual.iss ...and then create a new file called locmon.iss and put this in it:
    Code (Text):

    function main()
    {
       do
       {
          waitframe
        }
        while !${ISXEVE.IsReady}
        run locmon_actual
    }
     
    At least, that's the most simple solution I can imagine. There might be fancier ways to do it, but this method should work. Obviously, you could call the two files whatever you want (in case you want the list of running scripts to actually say "locmon" instead of "locmon_actual".)
  16. Drift3r

    Drift3r Active Member

    Messages:
    29
    How do I set this so that everyone who is not part of my Corp and/or Alliance or who do not have a standing of 5 and above is considered a hostile? Bearing in mind that I'm in 0.0.

    Edit: Does this script work in Inferno? Currently testing it out in High Sec and it counts everyone in local as friendly regardless of standings I set in the script, assuming changing 0 to 5 does anything in this script now.
    Last edited: Dec 31, 2012
  17. Karvinus

    Karvinus Member

    Messages:
    2
    how to get the full version of the script?
  18. SPEC1AL1ST

    SPEC1AL1ST Member

    Messages:
    28
    Amadeus you can help me with Locmon?
  19. SPEC1AL1ST

    SPEC1AL1ST Member

    Messages:
    28
    Help please :(
  20. Booyah

    Booyah Member

    Messages:
    9
    Just about finished a new version that will be ready for beta in a few days.

    It's got:
    • A GUI so you don't need to edit scripts to change settings
    • Configuration is now stored using LavishSettings
    • Black List - Alliance, Corp, Pilot
    • White List - Alliance, Corp, Pilot
    • Watch List - Alliance, Corp, Pilot
    • Customisable standings configuration
    • A few other little things

    I rewrote it using objects to try and keep it tidy, but the atomic nature of methods/members causes frame skipping on each poll if there's >50 pilots in local, so i'm rewriting the main code back to a simple script.

    I will post up another thread when it's complete.
  21. Drift3r

    Drift3r Active Member

    Messages:
    29
    NIOOOCE !! Much thanks and I can't wait to try it out.
  22. Booyah

    Booyah Member

    Messages:
    9
    Small progress update, this is still in the works.

    I'm just waiting on a bug with the extension to be fixed before I can go any further. (This one if you're interested.)
  23. MAALaR

    MAALaR Member

    Messages:
    10
    I've followed the instructions in the .iss file. This is my first time ever using InnerSpace, but I think I got the right idea. When I type 'run locmon' (no quotes), I get this response in console:

    Failed to initialize variable - object type 'index' rejected variable initialization
    Could not add variable named 'pilotIndex' in function call
    Main function call failed

    I'm not sure if this is something I'm doing wrong, or if your code just isn't compatible with the Tranquility server. I'd like a response soon please, as I'm running Inner Space on a trial at the moment. I don't want to pay for something that doesn't work.

    -MAALaR
  24. Amadeus

    Amadeus The Maestro Staff Member

    Messages:
    8,264
    Are you sure that ISXEVE is loaded? In other words, in the console, if you type echo ${ISXEVE.IsReady} does it say TRUE?

    Also, this is an old script written by someone who probably doesn't play the game anymore. So, while it's possible it might still run without alterations, you will most likely need to debug and make it work yourself. ISXEVE scripts here on the forums are open source and designed to be run and maintained by ISXEVE users.

    At this time, the only scripts for ISXEVE that are being actively maintained by an author are:
    Now, this doesn't mean that none of the other scripts work, it just means that they may not be actively being maintained by someone. But, as far as I know, everything on the forums should still work if someone took the time to update the script code where needed. ISXEVE has undergone changes over the years (it's 11 years old), but very, very little has ever been nerfed.
  25. MAALaR

    MAALaR Member

    Messages:
    10
    Thanks for the super quick response! I typed that into console and didn't see a response ....at all? o_O. I'm going to go ahead and assume it isn't running since I never actively setup ISXeve. In the instructions in the .ISS file, the author doesn't ever mention using ISXEVE at all. Let me look over how to get that working and see if it will work then.
  26. MAALaR

    MAALaR Member

    Messages:
    10
    Ok, I have ISXEVE successfully installed and authorized, patched and ready to go. I type "run locmon" and this is what I get in console:


    Error:No such 'eve' method 'DoGetPilots' @EVE:DoGetPilots[pilotIndex]
    Error parsing data sequence ''
    Dumping script stack
    --------------------
    -->C:/Program Files (x86)/InnerSpace/Scripts/locmon/locmon.iss:86 main() EVE:DoGetPilots[pilotIndex]
  27. bjcasey

    bjcasey ISX Specialist

    Messages:
    1,421
  28. MAALaR

    MAALaR Member

    Messages:
    10
    I have to say that looking over the ISXBJEVE setup, I'm confused af. It's not very clear, especially the purchasing. What am I buying? Why? What do I need to buy in order to get the local monitor? Very confusing. I'm going to keep looking at it and hope I can figure it out, but I'd like some help please.
  29. MAALaR

    MAALaR Member

    Messages:
    10
    I figured it out and have BJ Intel up and running.
  30. bjcasey

    bjcasey ISX Specialist

    Messages:
    1,421
    I know you said you got it, but for now ISXBJEVE is free while it's in testing. More information will be posted prior to paid launch.
  31. MAALaR

    MAALaR Member

    Messages:
    10
    If you can, try not to make it too expensive :p. I'm already paying for InnerSpace, ISXEVE, and then I'd have to also pay for ISXBJEVE too, that's a lot of money. :p Thanks for all the hard work you guys do, it's valuable.

Share This Page