getting item names
Is there a quest function that will return an item's name given it's id number? Not that it would be that difficult to write one, just wondering if one is already available...
Just an example, but rather than typing "rusty warhammer" I'd like to replace it with someFunction($item1), where someFunction fetches the item's name from the DB: Code:
sub EVENT_ITEM{ Jason |
The best way to accomplish this would be to call a function on the server, and have it returned to perl. I was working on a good way to do this, but it kind of petered out. The way I have things now, I can get something like this to work:
Code:
sub EVENT_ITEM{ |
This is more of a pre-submission. I think I have this worked out. I'll spare the details to create the code, and just give it to you. I've trimmed this down to the least amount of code to keep it workable, I think.. These changes all occur within the zone directory.
First, we are going to create a new file. Name it cperl.cpp, and paste into it the following: Code:
#ifdef EMBPERL Code:
#ifndef CPERL_H Code:
#include "embperl.h" Code:
#include "cperl.h" Code:
EXTERN_C void xs_init(pTHX) { char *file = __FILE__; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); } Code:
EXTERN_C void xs_init(pTHX) { Code:
perl->eval( Code:
perl->eval( Code:
../common/EMuShareMem.o ../common/EQEMuError.o beacon.o \ Code:
sub EVENT_ITEM { (last update 4/7/04) |
I've put this on our server with the intention of moving it to cvs from there. This seems to be the answer to the one problem with perl - the inability to get dynamic values back from the server.
I think we have the start of a solution for that here. Thanks for the great work m0oni9! |
All times are GMT -4. The time now is 01:11 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.