Local pilots

Zex

Active Member
Hi!

After a break i completly rewrote my script but i have the same issue as last time.

After some time my gui is stop working. My ship and overview not loading at all and autopilot stopping too.

Here is the code. If anybody have some idea please post it :)
Object:
http://pastebin.com/d26e7e334

Image about the hud hanging:

Thanx!

Some additional information:
it seams if i let it run in the same system then there is no problem. BUT! If i try to gate to an other system, after the arrival my eve hud forzen and my ship graphic isn't load.
 
Last edited:

Zex

Active Member
windows.xml
Code:
 <?xml version="1.0" encoding="UTF-8"?>
 <ISUI>
 	<Window name='Target Selector'>
 		<X>5</X>
 		<Y>5</Y>
 		<Width>200</Width>
 		<Height>400</Height>
		<Children>
		<TabControl name='Targeter'>
 				<X>5%</X>
 				<Width>90%</Width>
 				<Height>95%</Height>
 				<Tabs>
 					<Tab name='Blacklist'>
					<listbox name='Listbox'>
 							<X>5</X>
 							<Y>5</Y>
 							<Width>168</Width>
 							<Height>340</Height>
 							<Items>
 							</Items>
 						</listbox>
 					</Tab>
 					<Tab name='Options'>
					</Tab>
					</Tabs>
 			</TabControl>
 		</Children>
 	</Window>
 </ISUI>
 

Zex

Active Member
wt2.iss /Loader
Code:
variable(global) bool Quit = FALSE
#include obj_WT.iss

variable obj_WT WarTargets

function main()
{
	
Script:EnableDebugLogging[vv.txt]
ui -load windows.xml
	do
	{
		call WarTargets.ProcessState
		wait 10
		waitframe

	}
	while (${Quit} == FALSE)
}

function atexit()
{
	Event[OnFrame]:DetachAtom[This:Pulse]
	ui -unload windows.xml
	EndScript wt2
}
 

CyberTech

Second-in-Command
Staff member
Posting rest of script from pastbin for reference sake.

I don't see any reason offhand for the hud to hang

Code:
objectdef obj_WT
{
    variable string CurrentState
    variable time NextPulse
    variable int PulseIntervalInSeconds = 5
    variable bool Paused = FALSE
    
    variable index:pilot PilotIndex
    variable string _PilotName
    variable string _Alliance
    variable int _AllianceID
    variable int _PilotID
    variable int _PilotIDTemp
    variable int _CorpID
    variable int LastSolarSystemID
    variable index:int TemporalBl
    variable int LocalCounter
    
    
    method Initialize()
    {
        Event[OnFrame]:AttachAtom[This:Pulse]
        EVE:ActivateChannelMessageEvents
        LastSolarSystemID:Set[${Me.SolarSystemID}]
        echo obj_WT Inited in ${Universe[${LastSolarSystemID}]}
    }
    
    method Pulse()
    {
        variable int Counter
        
        if ${This.Paused}
        {
            return
        }
        
        if ${Time.Timestamp} >= ${This.NextPulse.Timestamp} && ${EVE.GetPilots} > 1 && ${Me.Ship(exists)}
        {
            if ${Me.SolarSystemID} != ${LastSolarSystemID}
            {
                LastSolarSystemID:Set[${Me.SolarSystemID}]
                echo Changed SollarSystem. Clearing Items
                UIElement[Target Selector].FindChild[Targeter].FindChild[Blacklist].FindChild
[Listbox]:ClearItems
            }
                    This.PilotIndex:Clear
                    EVE:DoGetPilots[This.PilotIndex]
                    
                    This.LocalCounter:Set[${EVE.LocalsCount}]


            This:SetState
            This.NextPulse:Set[${Time.Timestamp}]
            This.NextPulse.Second:Inc[${This.PulseIntervalInSeconds}]
            This.NextPulse:Update
        }
    }
        
    method Shutdown()
    {
        EVE:ActivateChannelMessageEvents
        Event[OnFrame]:DetachAtom[This:Pulse]
        ui -unload windows.xml
        EndScript wt2
    }

    method SetState()
    {
        if ${Quit}
        {
            This.CurrentState:Set["ABORT"]
        }
        else
        {
            This.CurrentState:Set["UPDATE"]
        }
    }

    function ProcessState()
    {
        switch ${This.CurrentState}
        {
            case ABORT
                call This.Shutdown
                break
            case UPDATE
                call This.Update_UI
                break
            case IDLE
                break
        }    
    }
    
    function Update_UI()
    {
        variable iterator PilotIterator
        PilotIndex:GetIterator[PilotIterator]
        
        if (${This.TemporalBl.Next[1]} > 0) 
        {
                do 
                {
                    This.TemporalBl:Remove[1]
                    This.TemporalBl:Collapse
                } 
                while (${This.TemporalBl.Next[1]} > 0)
                This.TemporalBl:Clear
        }
        
        if ${PilotIterator:First(exists)}
        do
        {
            This._CorpID:Set[${PilotIterator.Value.CorporationID}]
            This._AllianceID:Set[${PilotIterator.Value.AllianceID}]
            This._Alliance:Set[${PilotIterator.Value.Alliance}]
            This._PilotID:Set[${PilotIterator.Value.CharID}]
            This._PilotName:Set[${PilotIterator.Value.Name}]
            
                call CheckWTStatus
        } 
        while ${PilotIterator:Next(exists)}
        
        ;call CheckWTDel
    }
    
    function CheckWTStatus()
    {
        ;if (${This._AllianceID} == xxxxxx)
        ;    {
                This.TemporalBl:Insert[${This._PilotID}]
                call ProcessWT
        ;    }
    }
    
    function ProcessWT()
    {
        variable int i
        variable bool AllreadyEchoed = FALSE
        variable int counter
        variable int PilotIDformUI
        
        counter:Set[${UIElement[Target Selector].FindChild[Targeter].FindChild[Blacklist].FindChild
[Listbox].Items}]
        
        i:Set[1]
        AllreadyEchoed:Set[FALSE]
        
                    do
                    {
                        PilotIDformUI:Set[${UIElement[Target Selector].FindChild[Targeter].FindChild[Blacklist].FindChild
[Listbox].ItemByValue[${This._PilotID}].Value}]
                        if (${PilotIDformUI} == ${This._PilotID}) 
                        {
                            AllreadyEchoed:Set[TRUE]
                        } 

                        i:Set[${Math.Calc[${i}+1].Round}]                
                    } 
                    while (${i} <= ${counter})
                    if (${This._PilotID} > 0 && !${AllreadyEchoed})
                    {
                        UIElement[Target Selector].FindChild[Targeter].FindChild[Blacklist].FindChild
[Listbox]:AddItem[${This._PilotName},${This._PilotID}]
                    }
    }
    

}
 
Top Bottom