perl quest EMU simulator
Hello,
here is a small thing that can be used to test and debug perl quests. i hope this can be useful. It is a perl script that loads and run perl quests. It understands some basic commmands like #zone, #listnpcs, ... and allows to simulate quests much like the server. You can use it interactive (perl -w itest.pl), or batch ('cat myscript.txt | perl -w itest.pl'). http://perso.wanadoo.fr/afou/khalzed...ests/itest.jpg There are a few special commmands (to simulate GUI interaction): !target <id> ; selects a target !give <item> <item> ; ... is giving an item !givecash <cp> <sp> <gp> <pp> ; is giving cash !attack ; make you attack the npc !echo (on|off) ; allows echo on / off of commands, for batch use !timer ; triggers the timer. Note there is no real timing, quest::settimer and quest::stoptimer only give you information messages !whoami give information about the vars you export (charid, uguild, race, name, ...) !perl <foo bar> execs the perl script 'foo bar'. e.g. !perl $name="my new name" changes your name !verbose <0-9> ; changes verbose level. Useful for debugging !edit <filename> edits filename. It uses the EDITOR env variable (or vi if not set) to launch editor. if no filename is given, the quest file for current target is edited. if no such file, edits a new one. If no target, ... Note : quests are reloaded before each event is triggered. So editing a quest file and triggering an event triggers the new event directly. #kill, #zone, #level, #viewnpctype, #listnpcs, #npcstats, and /say, /shout, /emote, /ooc, /gsay /quit, and maybe a few others are already in the simulator. simple quest::foo functions are done. Look at the quest.pl file if you experience something strange. To run it, you need : db.ini, quest directory tree, the various plugin.pl and default.pl files and the files ./itest.pl, ./EQ/dbaccess.pl and ./quest.pl from the archive there The simulator is read-only on the DB, EXCEPT for quest_globals, that get affected if you want color, make sure you have Term::ANSIColor package in your perl INC, else simply uncomment first lines in itest.pl To change your character's info, alter the variables in the beginning of the itest.pl file,or do a command like Code:
!perl $ulevel=23 for example Code:
!verbose 1 Code:
EQEmu test >!verbose 1 Code:
; testing some system calls |
This looks really great!!
I mentioned it to Tark (our quest writer) and he just ran to his computer to get it :-) |
Glad if it could help. Let me know if it works fine for you (i did not test it under Win, only unix).
There might be (read 'there must be') some issues as i didn't get all knowledge of events. As a start, it was mainly intended to debug perl scripts (i.e. check syntax, and check that everything gets called). Some updates and fixes : changed the package scann that was giving confusing messages like "qst1234::EVENT_SAY = <undefined>" fixed issues with setglobal and delglobal DB calls setup quest::settimer, quest::stoptimer, quest::setsky,quest::movepc The above link has been updated There is the 'beggerprince' quest input Code:
; this plays a bit with the quest. NB alter the 205 npcid to reflect the id of qeynos2 npc, or vice versa Code:
loading plugins |
WOW! havent tested, but if it works as says, this will be a great tool.... Thanks smogo.
|
thx for encouragments. This is still very alpha, and not foolproof. But it would do no harm afaik, so anyone who would give a try and report is welcome.
There is a new version avalaible (same link above) added aliases : the !alias and !unalias allow to substitute in the command line. Usage is !alias <old> <new>, and !unalias <old>. It's better to single quote if you use regular expressions. Below is a sample : Code:
!echo on Code:
EQEmu test >!alias foo bar Other (minor) changes : fixed /ooc color $npcid and $mobid are now equivalent, as $mobid has no meaning in the simulator. Todo : some fixes ... Also i'm looking for information on EVENT_SLAY, #attack, ... to define procs that trigger / handle them. Any link you know of would be appreciated. |
updated :
- added internal mysql() function. You can call from prompt using : Quote:
forgot to mention that u can use script variables in your queries (else it wouldnt be any better than plain mysql client). Just don't forget to quote strings : Code:
!perl mysql("select count(id) from spawn2 where zone=\'$zonesn\'") - detailled trace of plugin loadin' todo : - still different package name of default quest as compared to EQEMu. No impact on regular use of the simulator. - finish quest::xxxx() functions - define basic combat sequence sub. Sthng like : upon attack/attacked, prompt for (N)PC dies / (P)layer dies / (A)uto / (D)isengage. Then trigger EVENT_DEATH, EVENT_SLAY, ... accordingly ***edited*** - alter $class. It is an id in the sim, should be a word as it is in EQEMu. |
no bumping, just wrong manip :lol:.
Sry. |
[root@plain rogean]# perl ./itest.pl
reading user reading host reading password reading database user : ra host : localhost ### --- be left "localhost" unless mysql is on a differant computer than world.exe. database : ra in quest library done with quest library :localhostt('ra ### --- be left "localhost" unless mysql is on a differant computer than world.e' (1) at EQ/dbaccess.pl line 25rver Host 'localhost closing database connection... Can't call method "disconnect" on an undefined value at EQ/dbaccess.pl line 343. END failed--call queue aborted. [root@plain rogean]# |
Quote:
i could not reproduce the error, but it might extra space, or in the password (a special char, or extrra space, or EOL comment). try removing leading / trailing space, all comments, or check with another pass. To get better report, try after changing lines 19-21 in EQ/dbaccess.pl to : Code:
foreach $var ( "user","host","database","password"){ Code:
[Database] |
There's a new version available, follow the same link above.
- $class now complies to EQEMu value, i.e. "Warrior", where it was "1" in previous version. - upgraded parsing the db.ini file, #comments should be no problem now. - preprocessed all say commands, so that quotes and dollar signs don't mess up, and u can use them in say. |
im a noob trying to learn perl lol. Where do i get the program? i didnt see a link or do you have to run it urself im a little confused. Probally cause im tired lol any help would be appreciated, please no flaming=)
|
the link is in the first post. It's there :
http://perso.wanadoo.fr/afou/khalzed...s/itest.tar.gz |
Thanks smogo! I didnt see it last night i was tired and sick=( Your a big help and thanks for making the tool
|
there is a quick fix to run the simulator on windows, for those who don't have *nix text utilities installed.
in EQ\dbaccess.pl file, in the first lines, comment out a block and add another, starting line 14 : Code:
#foreach $var ( "user","host","password","database"){ Also, you need the DBI and DBD modules. install them like this : Code:
C:>ppm |
I have one problem.
1.Downloaded your file 2.Installed DBI and DBD My SQL 3.Bunch of errors (DB connect) Should be because i dont understand this Quote:
|
the code quote is fix, because the simulator wasn't working under windows. it means you have to edit the EQ\dbaccess.pl file and modify it as described.
post your errors (first few lines if it's big). |
Im trying to run it under WinXP SP1.
Errors : [quote]K:\Everquest\Tools\PERL Script>perl -w itest.pl Name "main::key" used only once: possible typo at itest.pl line 259. Name "main::uguildid" used only once: possible typo at itest.pl line 63. Name "main::mobid" used only once: possible typo at itest.pl line 71. Name "main::fullanme" used only once: possible typo at itest.pl line 684. Name "main::target_pet" used only once: possible typo at itest.pl line 78. Name "main::uguildrank" used only once: possible typo at itest.pl line 64. Name "main::userid" used only once: possible typo at itest.pl line 60. reading user 'cat' n'est pas reconnu en tant que commande interne ou externe, un programme ex |
it seems you didn't make all the changes correctly. The old code was not commented out. Sry if the post was not too explicit.
Anyway, i updated the link, with new fixed code. Download the files again and run the simulator |
Your comment were ok, but my english is as good as your russian, but its always better to fix your code instead of letting newbies like me doing it by themselves :D
With your new code : Quote:
|
The first errors are perl warnings. You can ignore them.
the simulator runs from a base directory similar to EQEMu, (or preferably same directory). The error you get is the same error as EQEMu error when it can't find the plugin.pl file You need to have this file (it can be empty) in the directory you use the simulator from, just like db.ini, the plugin directory (possibly empty), a quests directory , ... i think that's all :) |
As usual Smogo /bow, thanks a lots for help.
All look like to work well :D |
Quote:
|
You haven't updated your database to use quest globals, checkout Sorcp2k's site and run the DB update (the binaries are trying to find the quest globals tables, but you don't have them in).
|
All times are GMT -4. The time now is 07:27 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.