Forums » Community Projects

CargoFind Plugin

Sep 22, 2007 smittens link
Version 1.0 - Download here. Thanks to Shape for the idea.

I made a plugin called CargoFind. What does it do, you ask? Well to see, let's look at my convenient (and oft-occurring) example:

You are in a sector. There is a giant ball of cargo, most of which you don't care about. But maybe there's an Axia Accelerated Positron in its midst? Well normally you would have to search through every bit of cargo. But no longer!

/cargofind "Axia Accelerated Positron"
/cargofind "Axia"
/Cargofind "Posi"
/Cargofind "Ax"

Basically, whatever you put in quotes, it'll find you the first widget (or stacked widget) with that in its name. This can be useful if you don't know how to spell the whole name, or in another example...

You jump into a sector with Oruns and Denteks, and a lot of cargo. Rather than shoot them, you want to collect processor cores. Rather than search for Orun Cores AND dentek cores, you can just type

/cargofind "Processor"

And it'll get you the first of either. Pick it up, rinse repeat repeat.

NOTE: This only works with cargo in your radar range.
Sep 22, 2007 raybondo link
I deleted the other duplicated thread.
Sep 22, 2007 smittens link
Oops, sorry. Thanks ray.
Sep 23, 2007 Lord~spidey link
great plug very useful when law harvesting or looking for something in a sea of cargo

thanks smittens awesome plug
Sep 23, 2007 ThinkHen link
Very creative use of RadarNext and RadarPrev. I wouldn't have thought of that.

Sep 24, 2007 look... no hands link
cool now all i have to do is setup a bind that brings up a chat box with the command already typed in so all i have to do is enter the search terms, should be simple enough.
Oct 23, 2007 blacknet link
try this

/alias CARGOFIND 'prompt cargofind'
/bind 'key' CARGOFIND

Oct 27, 2007 AJRimmer link
this is a god send..thanx
Nov 18, 2007 Killdog Deathwad link
This is a great plugin (kudos to Smittens) but there are times when I don't have time to type "/cargofind xyz" and so I'd really like to be able to setup a few commonly used search terms to keys so that all I have to do is hit a single key to find whatever it is I want.

For example, say you often want to find scrap metal, I'd like to have "/cargofind scrap" bound to a key. According to the posts below, I thought that i'd be able to do that by putting the following in my wgaf.cfg file:

alias CFscrap "prompt /cargofind scrap"

...and in my config.ini file:


but this doesn't seem to work. The button bind works fine but the alias doesn't work as expected with the plugin.

Using the prompt command did bring up a prompt containing the text stated but I still had to manually hit enter (which, ideally, I'd like to avoid) and, in any case, it didn't do anything, it didn't appear to be talking to the cargofind script at all.

I came to this conclusion because, looking at the code for the cargofind script, it seems that there are 3 possible "outcomes" (for want of a better word). These are:

1) It finds an item according to the string entered
2) It returns a message stating that there is no item matching that string
3) it returns a messages informing the user of the syntax required to use cargofind.

Using "prompt" in the alias above resulted in none of these so I can only assume that the prompt command is not talking to the cargofind script at all.

Another thing I tried was using the say_channel command. I tried this because, according to my, admittedly poor, understanding, if you can type "/cargofind xyz" into chat and have it work then, logically, you should be able make an alias that says:

alias CFxyz "say_channel /cargofind xyz"

and have it also work successfully.

Of course, I've tried this and it doesn't work. This seems strange to me but, as I said, I have a very poor grasp of how this all works.

On the advice of a fellow guild member, I also tried:

alias CFxyz "/cargofind xyz"

but I had no luck there either.

So, I'm a bit stuck. I'm not sure where to go from here. I've searched the forums (fora?) to no avail and the wiki doesn't cover specifics like this so I'm hoping that one of you bind gurus will impart some of your wisdom.

Can this be done? Is it possible without resorting to lua? It seems like it should be quite simple.

Anyway, if anyone can help, I'd appreciate it.


PS: here a list of the things I tried but that did not work...

alias "/cargofind xyz"
alias "prompt /cargofind xyz"
alias "echo /cargofind xyz"
alias "say /cargofind xyz"
alias "say_channel /cargofind xyz"
Nov 19, 2007 smittens link
You do:

/alias FindWhatever "cargofind 'Item Name'"
/bind YourKey FindWhatever

Make sure to put single quotes around Item Name.

This was useful in the nation war when I had to find Tumble (to follow his lead). My FindTumble alias was a smashing success!
Nov 19, 2007 Killdog Deathwad link
Ahhh, of course. Once again, I am thwarted by the smallest of details. I should know better by now.

Thanks Smit, it works like a charm now.

Jan 27, 2009 Daare link
Link is dead. Any chance this plugin can be hosted elsewhere? I miss my /cargofind.
Jan 28, 2009 maq link
Jan 28, 2009 Daare link
Many thanks!
May 29, 2009 DarBar link
How 'bout a function in /cargofind like ls

/cargofind ls
would list all cargoes within radar range, so you can see what is there before you ask where a specific item is...
So when i pop a trader and have vprs chasing me, i can infiniturbo around and decide what i'm going to pick up


May 29, 2009 maq link
cargolist does exactly that.
May 30, 2009 DarBar link
/me has just figured that out. thx. :P
May 31, 2009 smittens link
Hey Mick, I hope it's alright (just let me know if not and I'll take it down), but I changed the link in my original post to the link you gave where it is still hosted. Thanks :)
Jun 01, 2009 maq link
Sure, it should stay there for a while tho if something happens to it i'll likely not notice.
Jul 22, 2009 Shapenaji link
How about regular expressions? suppose I want all "*blaster*" on the field?