EOSERV Forum > EOSERV > searching for command that gives item info
Page: << 1 >>
searching for command that gives item info
Author Message
Post #204259 searching for command that gives item info

Im looking for a loop through all items, or a command which shows item description, such as #item gun - (item id, damage etc) i can't find any code


@edit


Ok i kinda figured it out. Idk if it's optimized, or something, but it works. Here's the code for item finder, and npc finder with drop info


https://pastebin.com/wuPLsMtK


in-game pics: 




@edit2 lol i kinda forgot to add exp info xD


working code: sratata

37 weeks, 2 days ago
Post #204284 Re: searching for command that gives item info

So this will look up any npc or item by name as well as give you information on what it drops or its stats are? where exactly do you place this code into?

---
"I would rather be in the light looking up to the darkness, than being in the darkness looking up to
the light."
~Tensuki
36 weeks, 5 days ago
Post #204285 Re: searching for command that gives item info

The code seems to have some arbitrary limits, 650~ for items and 700 for npcs? Is there no way of using the amount of items that loaded when EOSERV starts? It's been a while since I worked with EOSERV but I'm pretty sure there's the whole 500 Item(s) loaded, 500 NPC(s) loaded etc when you boot EOSERV

---
If money doesn't grow on trees, then why do banks have branches?
36 weeks, 5 days ago
Post #204286 Re: searching for command that gives item info

I know that somewhere there is variable holding eif size or enf size, but i just kinda hardcoded it. You can edit it, put the value in config, or use this variable i mentioned, but idk where it is xD You also can type there any number you want, eg 13000 and it still will work


Tensuki posted: (11th Jul 2018, 01:34 am)

So this will look up any npc or item by name as well as give you information on what it drops or its stats are? where exactly do you place this code into?

in talk.cpp with your other # commands

36 weeks, 5 days ago
Post #204287 Re: searching for command that gives item info
deaviss posted: (11th Jul 2018, 08:19 am)

I know that somewhere there is variable holding eif size or enf size, but i just kinda hardcoded it. You can edit it, put the value in config, or use this variable i mentioned, but idk where it is xD You also can type there any number you want, eg 13000 and it still will work


Tensuki posted: (11th Jul 2018, 01:34 am)

So this will look up any npc or item by name as well as give you information on what it drops or its stats are? where exactly do you place this code into?

in talk.cpp with your other # commands


Just change the loops to check the size() ex: for(int i=0; i<character->world->enf.size()-1; i++)   for(int i=0; i<character->world->eif.size()-1; i++)   for(int i=0; i<character->world->esf.size()-1; i++) 
36 weeks, 5 days ago
Post #204289 Re: searching for command that gives item info
insomniac posted: (11th Jul 2018, 08:33 am)

deaviss posted: (11th Jul 2018, 08:19 am)

I know that somewhere there is variable holding eif size or enf size, but i just kinda hardcoded it. You can edit it, put the value in config, or use this variable i mentioned, but idk where it is xD You also can type there any number you want, eg 13000 and it still will work


Tensuki posted: (11th Jul 2018, 01:34 am)

So this will look up any npc or item by name as well as give you information on what it drops or its stats are? where exactly do you place this code into?

in talk.cpp with your other # commands


Just change the loops to check the size() ex: for(int i=0; i<character->world->enf.size()-1; i++)   for(int i=0; i<character->world->eif.size()-1; i++)   for(int i=0; i<character->world->esf.size()-1; i++) 

error: request for member 'size' in 'character->Character::world->World::enf', which is of pointer type 'ENF*' (maybe you meant to use '->' ?)|

you fogtot 'data'

correct code is for(int i=0; i<character->world->enf->data.size()-1; i++){

But thanks anyway! :D

36 weeks, 5 days ago
Post #204290 Re: searching for command that gives item info
deaviss posted: (11th Jul 2018, 08:50 am)

insomniac posted: (11th Jul 2018, 08:33 am)

deaviss posted: (11th Jul 2018, 08:19 am)

I know that somewhere there is variable holding eif size or enf size, but i just kinda hardcoded it. You can edit it, put the value in config, or use this variable i mentioned, but idk where it is xD You also can type there any number you want, eg 13000 and it still will work


Tensuki posted: (11th Jul 2018, 01:34 am)

So this will look up any npc or item by name as well as give you information on what it drops or its stats are? where exactly do you place this code into?

in talk.cpp with your other # commands


Just change the loops to check the size() ex: for(int i=0; i<character->world->enf.size()-1; i++)   for(int i=0; i<character->world->eif.size()-1; i++)   for(int i=0; i<character->world->esf.size()-1; i++) 

error: request for member 'size' in 'character->Character::world->World::enf', which is of pointer type 'ENF*' (maybe you meant to use '->' ?)|

you fogtot 'data'

correct code is for(int i=0; i<character->world->enf->data.size()-1; i++){

But thanks anyway! :D


My bad, I've got to many projects going on at once I didnt have a src open when I wrote that good push in t he write direction though.
36 weeks, 4 days ago
Post #204452 Re: searching for command that gives item info

I had a problem on this, the command works but at the end of item details the Server sent another message stating Unknown command.

Edit : Fixed :D

20 weeks, 1 day ago
Post #204453 Re: searching for command that gives item info

Bit off-topic but I have the $itemid command working on a rev 535! it only gives you the ID & type of an item but it's kind of helpful:



Just throw all this in commands/debug.cpp


code

---
https://Havenshost.net/ - Cheap Windows VPS
19 weeks, 6 days ago
Post #204459 Re: searching for command that gives item info
alicetaylor posted: (6th Nov 2018, 01:46 am)

Thanks for sharing the information. It is very useful for my future. keep sharing


run 3


Someone delete this random-ass spam (link goes to some game site called run3?) 

Bots are getting a bit more creative now I guess.

---
Want to learn to pixel?
Pixelsource.org
19 weeks, 5 days ago
Post #204460 Re: searching for command that gives item info

I think my problem is only a temporary fix, as there's already a command exist with the same name :

# Returns information about an item
# $item id
item = 1 (0 for players)

# Returns information about an npc
# $npc id
npc = 1 (0 for players)

that's why it'll say Unknown command because you suppose to put ID instead of a name which this suppose to do, even if I changed the command to something like itemname/npcname it'll display all the info but still say Unknown command at the end. I've remove a line which direct it to saying Unknown command and it disappeared now but it won't say Unknown command when I enter something like #tiem. Where should I put this code anyway? I tried adding this to your rev Callum, but no luck.


P.S. Not a legit coder, just a copy paster kind of coder wanna be

19 weeks, 5 days ago
Post #204466 Re: searching for command that gives item info
Slyke posted: (7th Nov 2018, 09:23 am)

I think my problem is only a temporary fix, as there's already a command exist with the same name :

# Returns information about an item
# $item id
item = 1 (0 for players)

# Returns information about an npc
# $npc id
npc = 1 (0 for players)

that's why it'll say Unknown command because you suppose to put ID instead of a name which this suppose to do, even if I changed the command to something like itemname/npcname it'll display all the info but still say Unknown command at the end. I've remove a line which direct it to saying Unknown command and it disappeared now but it won't say Unknown command when I enter something like #tiem. Where should I put this code anyway? I tried adding this to your rev Callum, but no luck.


P.S. Not a legit coder, just a copy paster kind of coder wanna be


Currently in work now but I when I’m home I’ll post a small guide on where to add this into a vanilla eoserv. My basic 535 release already has this though..


Usage: $itemid dagger

---
https://Havenshost.net/ - Cheap Windows VPS
19 weeks, 3 days ago
Page: << 1 >>

EOSERV Forum > EOSERV > searching for command that gives item info