IGB Javascript Functions
From EVEDev
Contents |
[edit] Function list
[edit] Always available functions
| Function | Arguments | Description | Example |
|---|---|---|---|
| CCPEVE.openEveMail | none | Opens the EVE mail window. Same behaviour as when a user clicks the EVE mail icon on the left bar. | CCPEVE.openEveMail(); // Show mail window |
| CCPEVE.showInfo | integer typeID [, integer itemID] | Opens the info window for the specified type. The first argument must be a typeID that is listed in the invTypes table of the static data dump.
The second parameter is used to specifiy a single entity of the given type. It can be a
| CCPEVE.showInfo(2, 109299958); // Corporation CCPEVE.showInfo(16159, 434243723); // Alliance CCPEVE.showInfo(30, 500002); // Faction CCPEVE.showInfo(1377, 3008416); // Character, agent CCPEVE.showInfo(1377, 1736529287); // Character, player CCPEVE.showInfo(3, 10000001); // Region CCPEVE.showInfo(4, 20000002); // Constellation CCPEVE.showInfo(5, 30000001); // Solar system CCPEVE.showInfo(6); // Sun type CCPEVE.showInfo(13); // Planet type CCPEVE.showInfo(32444); // Inventory item |
| CCPEVE.showRouteTo | integer destination [ , integer origin] | Shows the route to the given destination on the map from current position or (if given) from origin. Both destination and origin must be solarSystemIDs
Bug: Often the map does not load. | CCPEVE.showRouteTo(30000001); // Route to Tanoo CCPEVE.showRouteTo(30000001, 30003276); // Route from FD-MLJ to Tanoo |
| CCPEVE.showMap | [integer solarSystemID] | Opens the map view. If a solarSystemID is given, the map is centered on this system.
Bug: Often the map does not load. | CCPEVE.showMap(); // Open the map CCPEVE.showMap(30000001); // Center map on Tanoo |
| CCPEVE.showPreview | integer typeID | Show the preview window of the given type. Only inventory types that can be deployed in space, thus have a model, can be used. | CCPEVE.showPreview(597); // Ship CCPEVE.showPreview(2486); // Drone |
| CCPEVE.showFitting | string shipDNA | Show the fitting window for the given ship and it's components. See section about Ship DNA for information about its structure.
Important: The fitting is not validated, you can pass a fitting were a rookie ship has a dooms day device. | // Punisher with a Salvager CCPEVE.showFitting('597:25861;1:6673;3:439;1:4025;1:1183;1:1998;1:1236;1:11269;1::'); // Punisher with a Capital Shield Transporter I CCPEVE.showFitting('597:3616;1:6673;3:439;1:4025;1:1183;1:1998;1:1236;1:11269;1::'); |
| CCPEVE.showContract | integer stationID, integer contractID | Show the info window about the given contract. First parameter must be the stationID of the station were the contract was issued.
The contractID can currently only be found in the WalletJournal of a character or corporation. | CCPEVE.showContract(60012607, 10); |
| CCPEVE.showMarketDetails | integer typeID | Open the market window (if not already open) and show the list of buy and sell orders for the given item | CCPEVE.showMarketDetails(20); // Show market orders of kernite |
| CCPEVE.requestTrust | string url | Open the request trust dialog, to confirm trust for the given URL. Has no effect if this URL is already trusted, or ignored.
See the section about trust below for details. | CCPEVE.requestTrust('http://wiki.eve-id.net'); // Request trust for this wiki |
[edit] Functions that require trust
See the section about trust below for details.
| Function | Arguments | Description | Example |
|---|---|---|---|
| CCPEVE.setDestination | integer solarSystemID | Set the autopilots destination to the given solarSystem | CCPEVE.setDestination(30000001); // Set destination to Tanoo |
| CCPEVE.addWaypoint | integer solarSystemID | Add a waypoint to the autopilots route | CCPEVE.addWaypoint(30000001); // Add Tanoo to the current route |
| CCPEVE.joinChannel | string channelName | Join the given channel, asks if the channel should be created if it does not exist.
Not case sensitive | CCPEVE.joinChannel('freelancer'); // Join the "Freelancer" channel |
| CCPEVE.joinMailingList | string channelName | Join the given mailing list, succeeds silently. If the mailinglist does not exist, an error is shown
Not case sensitive | CCPEVE.joinMailingList('SomeList'); // Join the "SomeList" mailing list |
| CCPEVE.createContract | integer type of contract [, integer stationID [, string itemIDs]] | Open the contract wizard, with the given type already selected. Type can be
If stationID is given, this station is selected, otherwise the current or last station is selected itemIDs are a string of comma separated itemIDs that can be found in the Asset List. If no items are given, they must be selected in the wizard. | CCPEVE.createContract(1); // Create a trade contract CCPEVE.createContract(1, 60000004); // Create a trade contract in Muvolailen X - Moon 3 - CBD Corporation Storage CCPEVE.createContract(1, 60000004, '1,2,3,4'); // Create a trade contract with items already selected |
| CCPEVE.sellItem | integer stationID, string itemID | Open the wizard for creating new sell order. itemID can be found in the Asset List | CCPEVE.sellItem(60000004, '1234'); // Sell item 1234 in Muvolailen X - Moon 3 - CBD Corporation Storage
|
| CCPEVE.buyType | integer typeID | Open the wizard for buy orders for the given type. | CCPEVE.buyType(20); // Buy kernite |
| CCPEVE.findInContracts | integer typeID | Open the contract search and searches for contracts with the given type | CCPEVE.findInContracts(20); // Find contracts with kernite |
| CCPEVE.addToMarketQuickBar | integer typeID | Add the given type to the quick access bar of the market window. Succeeds and fails silently. | CCPEVE.addToMarketQuickBar(20); // Add kernite to the market quick bar |
| CCPEVE.showContents | integer locationID, string(number) itemID | Show contents of the given item at given location. locationID is typically a station. itemID is a 64-bit number, thus should be passed as string. itemID can refer to a container or a ship. | CCPEVE.showContents(60000004, '12345'); // Show contents of given item |
| CCPEVE.addContact | integer characterID | Open the window to add a given character to the address book. If it is already there, the edit contact window is shown. | CCPEVE.addContact(1736529287); // Add or edit the character in(to) the contact list. |
| CCPEVE.addCorpContact | integer characterID | Same as addContact, but for corporation contacts. | CCPEVE.addCorpContact(1736529287); // Add or edit the character in(to) the contact list. |
| CCPEVE.removeContact | integer characterID | Removes the given character from contact list. If called, a confirmation dialog shows up. This dialog can be disabled via a tick at "remember my decision and do not ask me again". If that is active, it succeeds silently. | CCPEVE.removeContact(1736529287); // Remove the character from) the contact list. |
| CCPEVE.removeCorpContact | integer characterID | Same as removeContact, but for corporation contacts. If a users permissions are not high enough, a javascript exception is thrown. | CCPEVE.removeCorpContact(1736529287); // Remove the character from the contact list. |
| CCPEVE.block | integer characterID | Blocks a given character. If called, a confirmation dialog shows up. This dialog cannot be disabled by a user. | CCPEVE.block(1736529287); // Block the character |
| CCPEVE.inviteToFleet | integer characterID | Invite a character to a fleet, or form a new fleet user is not in one. If called, a confirmation dialog shows up. This dialog cannot be disabled by a user. | CCPEVE.inviteToFleet(1736529287); // Invite the character |
| CCPEVE.startConversation | integer characterID | Invite the character to a private conversation. If called, a confirmation dialog shows up. This dialog cannot be disabled by a user. | CCPEVE.startConversation(1736529287); // Invite the character |
| CCPEVE.addBounty | integer characterID | Opens the add bounty wizard of the bounty offics window, with the given character selected. | CCPEVE.addBounty(1736529287); // Add bounty to character |
| CCPEVE.showContracts | integer corporationID | Open the search contracts window and shows all contracts of the given corporation | CCPEVE.showContracts(109299958); // Show contracts of corporation |
| CCPEVE.showOnMap | [integer regionID|constellationID|solarSystemID] | Opens the map and center it on the given celestial object. The ID can be
CCPs [Game Browser Demo] page lists corporationID as a possible parameter, but this does not seem to work | CCPEVE.showOnMap(); // Just open the map CCPEVE.showOnMap(10000001); // Center map on region Derelik CCPEVE.showOnMap(20000002); // Center map on constellation Anares CCPEVE.showOnMap(30000001);// Center map on system Tanoo |
| CCPEVE.editMember | integer characterID | Open the corporation info window about the given character
Users with sufficient rights get the edit view Fails silently for characters not in the corporation | CCPEVE.showContracts(109299958); // Edit / show infos about the character |
| CCPEVE.awardDecoration | integer characterID | Opens the wizard with the given user selected. | CCPEVE.awardDecoration(109299958); // Award the character |
| CCPEVE.sendMail | integer characterID|corporationID|allianceID, string subject, string body | Open the new mail window with the given subject and body to the given receipients already filled out. Receipient can be
Only one receipient is allowed, sending a mail to several is not possible. Subject and body are mandatory as well and must not be empty. A single space character is allowed though. | CCPEVE.sendMail(109299958, 'Happy birthday', 'Congrats'); // Send a mail to the user CCPEVE.sendMail(109299958, ' ', ' '); // Send the mail with "empty" subject and body |
| CCPEVE.bookmark | integer celestialID | Open the add bookmark window, with the position of the given object and its name prefilled. The ID can be any object that is inside a solar system, like
| CCPEVE.bookmark(40455687); // Moon CCPEVE.bookmark(40455686); // Planet CCPEVE.bookmark(40000001); // Star / Sun CCPEVE.bookmark(60014863); // Station |
| CCPEVE.showSovereignty | unknown | This function is available in IGB but does not have any effect. See the section about issues for more information | none |
| CCPEVE.clearAllWaypoints | none | Remove all waypoints from the autopilot, including its destination. | CCPEVE.clearAllWaypoints(); // Remove all previously set waypoints or the destination |
[edit] Further information
[edit] Consider
- Most functions fail silently when an error occurs. The logserver (if running) will contain information about it, but - unlike in other browser - no exception is thrown.
- The EVE client is a 32-bit program, so the IGB cannot handle integers that are outside the clients scope. If 64-bit numbers must be passed, make sure to pass them as strings.
- Most functions do not differ between string numbers and integer numbers.
[edit] Ship DNA
[edit] Description
Ship DNA is a string of typeIDs and quantity values to describe a ship and a fitting. Using the CCPEVE.showFitting function, this fitting can be displayed in-game. Layout:
Ship[:Subsystems]:HIGH SLOTS:MED SLOTS:LOW SLOTS[:RIGS[:CHARGES AND DRONES]]
Ships modules and charges/drones are defined by their typeID, which can be found in the invTypes table of the static data dump. A module or charge must always have a quantity value which is a number preceeded by a semikolon
TYPEID;QUANTITY
The ship and its fitting areas are separated by a colon. There must be at least three of them to separate high, med and low slots. Even if they are empty. eg.: For just showing the ship, give the ships ID followed by three colons Modules in slots are their typeIDs, a semikolon and the amount fitted. eg.: Show a ship with two different modules in high slots, having three modules in high slots: Values in fitting slots are optional in case there are no modules in high med or low slots. Three colons are mandatory though. Rigs and drones can be added just like modules. The sorting of the modules is of no consequence. It is important to keep in mind that the fittings are not validated, eg.: show a rookie ship with modules that can only be fitted on capital ships is possible.
[edit] Examples
CCPEVE.showFitting('587:::'); // Show a rifter CCPEVE.showFitting('587:485;2:486;1::'); // Rifter with 2x 150mm Autocannon and 1 x 200mm Autocannon CCPEVE.showFitting('587:30987;2::'); // Rifter with two Small Trimark Armor Pump I rigs CCPEVE.showFitting('587:30987;2:485;2:486;1::'); // Rifter with three cannons and two Small Trimark Armor Pump I rigs CCPEVE.showFitting('587:3616;1:24552;1::'); // Rifter with Capital Shield Transporter I and Oblivion doomsday device
[edit] Trust
[edit] Description
All functions in the section Functions that require trust will fail silently, unless the user trusts the site. Trust can be requested using the
CCPEVE.requestTrust();
function. This function opens a window were the user has to confirm or decline the request for trust. Once confirmed, a green tick in the lower right corner of the IGB is displayed and the functions work. As a parameter a fully qualified domain name must be given. This can be an URL, a domain only and can contain wildcards. If only a domain is given, IGB automatically adds a wildcard to grant trust to all pages on this domain.
[edit] Examples
CCPEVE.requestTrust('http://wiki.eve-id.net/IGB_Javascript_Functions'); // Request trust for this site only CCPEVE.requestTrust('http://wiki.eve-id.net'); // Request trust for all pages on the wiki CCPEVE.requestTrust('http://wiki.eve-id.net/*'); // Request trust for all pages on the wiki CCPEVE.requestTrust('http://*.eve-id.net'); // Request trust for all pages on all subdomains of eve-id.net
[edit] Issues
- All methods that open the map, sometimes fail at the last step. All windows are minimized, the map panel is shown, but the map itself is not loaded. A repeated call to the same function does not change anything. If the map is already open, they work as expected.
- IGB contains a CCPEVE.showSovereignty method, that does not seem to be implemented. No action is shown in the client and the logserver shows an uncaught exception.

