Setting Status ?
Just a quick question,
I was looking through the function list to see if there was something I could add to an npc script to set a players account status. For example, raise it from 0 to 1 ? What my intentions are here, is having the bot cmd access at 1 and then an npc will raise the player status to 1 when required level is met, giving the player access to the bots. |
This assumes you have Perl DBI installed.
/plugins/statusupdate.pl Code:
sub UpdateStatus { Code:
sub EVENT_SAY { |
Thanks ghanja for that snippet.
I'm still trying to get it to work though, (chuckle) I created the plugin (statusupdate.pl) and put it in the plugins folder.(restarted server) On the npc, I had to add a $text and $level along with the call for status. This is what I've got so far. Code:
sub EVENT_SAY { I'll keep piddling around with it though. |
I copy pasted mostly from a portion of code I already had written (however it was just a subroutine in a player.pl), added the $statuslevel and gave it a plugin filename. Sorry for not placing the plugin:: before UpdateStatus
Are you certain you have Perl DBI installed? Also, I would up your logging (its my preferred setting anyway), do this in game: Code:
#logs set gmsay 20 3 Code:
sub EVENT_SAY { http://wiki.eqemulator.org/p?Install..._other_Modules |
Quote:
so far. I ran those logging cmds you suggested, seemed to show success in the console, but when looking in logs, the only thing I am seeing related to any quests is this : Code:
[06-22-2016 :: 17:30:13] [Quests] Useless use of a variable in void context at quests/nexus/Bot_Giver.pl line 5. me. But that's the only thing showing up in any logs. I did contain it all on the NPC, as you suggested. Still nothing happening. The only reaction I get from NPC is on the "hail", it faces me, as normal. Code:
sub EVENT_SAY { |
Quote:
|
Quote:
|
Quote:
the script is not working. Through his suggestions, the perl DBI has been reinstalled, the MySQL.pl has been looked at, but still plugging away troubleshooting. The rest of my scripts work, just not this new challenge.(chuckle) |
Ok, got the DBI connection problem solved. simple little "technical difficulty" (chuckle)
Had to change "localhost" to 127.0.0.1 in the script. |
Many thanks to ghanja for all the help in getting this "set status" goal achieved.
It's all working good now, but with a lot of help from ghanja in trouble shooting the DBI connection problem.(he gave me some debug scripts to run). Then, of course the NPC script that he provided was the icing on the cake. |
Just thought I would share what the end results were for an npc to set the
player status (increase). Just in case anyone else is interested in using it. This is all with the great help of ghanja :) In the plugins folder, the MySQL.pl file was renamed to MySQL(old).pl but you can use whatever you want. A new one was created with the following: You will have to EDIT the credentials for your DB.(database name, password) Code:
sub MySQL_Connect { desired status is needed to be raised to. (this one raises it from 0 to 1) It also requires a level of 10 before the NPC will raise it for you. You can edit that to your likings. I've tested this 3 times now and all working good. Code:
sub EVENT_SAY { |
All times are GMT -4. The time now is 11:11 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.