Jump to content
  • 0

getinventorylist


Pneuma

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

Okay I need help NOW with this command;

I want to know how to invoke the checking of specific ID and the amount of that item in their inventory

* getinventorylist;

This command sets a bunch of arrays with a complete list of whatever the
invoking character has in their inventory, including all the data needed to
recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_id[] - array of item ids.
@inventorylist_amount[] - their corresponding item amounts.
@inventorylist_equip[] - whether the item is equipped or not.
@inventorylist_refine[] - for how much it is refined.
@inventorylist_identify[] - whether it's refined.
@inventorylist_attribute[] - whether it is broken.
@inventorylist_card1[] - These four arrays contain card data for the items.
@inventorylist_card2[] These data slots are also used to store names
@inventorylist_card3[] inscribed on the items, so you can explicitly check
@inventorylist_card4[] if the character owns an item made by a specific
craftsman.
@inventorylist_count - the number of items in these lists.

inbetween the sleep2 1000; command and the next; command, I would like to have it check how much of the item 6096 and then it removes that amount and sends a query_sql to a table and adds +1*each item deleted

bFish:
next;
 mes "Checking inventory...";
 sleep2 1000;

 next;

If possible; also make me a sql command for when turning in the fish for the first time it adds their name to the ladder;

Table: fishladder

Columns: char_id, name, score

Edited by Skyrim
Link to comment
Share on other sites

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  23
  • Reputation:   3
  • Joined:  12/10/11
  • Last Seen:  

So I suggest you to use the script on #21.

Please tell me if it doesn't work too.

Ps. The Replace command can be either update and insert in one command

(If you wanna update new score plus old score just select an old score first and then plus it with new score and then replace)

Edited by Magic-Maker
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  846
  • Reputation:   137
  • Joined:  02/26/14
  • Last Seen:  

Well What I did was I combineded the 2 posts :/

if(countitem(6096)){
set .@noitem,countitem(6096);
if ( query_sql("SELECT `score` FROM `fishladder` WHERE `char_id`="+getcharid(0), .@score) ) {
 // row exists, update it
query_sql "REPLACE INTO `fishladder` SET `score` = "+(.@score+(.@noitem))+",`char_id` = "+getcharid(0)+",`name` = '"+strcharinfo(0)+"'";
} else {
 // else, insert new row
 query_sql "INSERT INTO fishladder (`char_id`,`name`,`score`) VALUES ("+getcharid(0)+",'"+strcharinfo(0)+"',"+.@noitem+")";
}

When I did that it worked...so..You were close.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...