Specific scripting questions

Thamuz

Member
First off I am attempting to make a set of scripts for use in WHs. This is my first time really programming anything so please bear with me. The order I plan to make them in is: salvager, analyzer/hacker, site clearing, and logi. I think that order is easiest to hardest. but I have come across several questions that I cannot find the answers to and I will likely have many more by the time I have these completed to my satisfaction. Now on to the questions that I can remember and please remember I am new to programming and I am trying to look at other scripts and the lavishsoft wiki to do most of my learning.

1) By looking through other scripts I can see that you can target by groupID. Is there any way to get the entities name or type (like I would see in the overview). i would like to treat different wrecks a little differently and this would also help when it comes time to analyze/hack cans and more specifically this will be essential for the combat.

2) How can I prompt for user input? Sounds simple enough, but I haven't been able to find an example of it anywhere. I know I could just give options and I plan to give them in a drop down box in a GUI. But I think I am a long way from doing a GUI.

3) Can you suggest any other scripts I should be looking at for examples other than:
evesalvage
wreckingball2 (mainly for a different look at the logic)
evebot (haven't looked to deep into this one since it is large and I don't think it currently salvages)

Any other tips or advise would be welcomed. Thanks
 

tinyromeo

Active Member
1) Targeting is handled any way you want it. Look through the Entity datatype, any of the properties there can be searched for through the Entity top level object. For example, open up the wreckingball2 folder, in the debug folder there is a file named EntityListingA.XML. I spent a great deal of time cataloging every entity (and item) I came across and saving their 3 main attributes, Category, Group, and Type. Most of us use Group or GroupID to search as these are generally "All of the wrecks" or "all cargo containers (which is actually ONLY cargo containers not spawn containers for archeology) or "all sansha rat cruisers". You will notice however that there are many entities that share the same category, group, and type, but like I said earlier you can search by ANY property mentioned in the Entity datatype like so...
Code:
Entity[Name =- "Sansha Minion"]:Approach
EVE.QueryEntities[Entities, CategoryID == 2 && Distance <= 2500]
And never forget once you have a general list of entities you can always refine it more thoroughly by iterating through the entities and doing other comparisons
Code:
EVE:QueryEntities[Entities,CategoryID == 11]
Entities:GetIterator[Iter]
if ${Iter:First(exists)}
do
{
 if ${Iter.Value.Group.Find["Battleship"]}
 {
  Iter.Value:LockTarget
  wait 5
 }
}
while ${Iter:Next(exists)} && ${MyShip.MaxLockedTargets} > ${Math.Calc[${Me.GetTargets} + ${Me.GetTargeting}]}
2) I have never personally done this so I won't blow too much smoke up your ass, but I believe it will have something to do with binds and events. For instance you can register an event that does nothing more than toggle a bool true/false (or any other atomic function(no waiting allowed)), and a bind that triggers the event. I think in code it would look a little like this...
Code:
variable(script) bool TheToggle = TRUE
function main()
{
 LavishScript:RegisterEvent["Command"]
 Event[Command]:AttachAtom[atomCommand]
 Bind bindCommand f8 "-event Command"
 while ${TheToggle}
  wait 1
 Event[Command]:DetachAtom[atomCommand]
 Event["Command"]:Unregister
}

atom atomCommand
{
  echo "Event"
  TheToggle:Toggle
}
Can't promise that this snippet is accurate, but should layout the foundation needed for you.

3) This
Sometime I will get off my lazy ass and put some more into my tutorial, but yeah, lazy and ass go together well.

edit - I reread #2 and now it sounds to me like you are asking for a string input? Like you want to ask the user what group of rats to shoot at? A gui would of course be the best option, but there are also arguments! For instance when you run EVESalvage you have to add stuff like -here -stop BookmarkLocation, these are arguments and evesalvage gives a great example of how to handle those right at the top. But if you don't want something variable and complex like that you can always ask for individual arguments eg...
"run EchoTest string1 83 doggies"
Code:
function main(string _str1, int _val1, string _str2)
{
 echo ${_str1}
 echo ${_var1}
 echo ${_str2}
}
 
Last edited:

Amadeus

The Maestro
Staff member
By the way, the EVESalvageLibrary.iss was designed to be used in other scripts. It's just a collection of functions that do various things. EVESalvage.iss is the wrapper.
 
Top Bottom