Jump to content
  • 0

how to call script that is in a text column in mysql


keithit110

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  05/29/15
  • Last Seen:  

I have a lookup table in mysql where it has an ID and script column. On the script column it contains text data like on the code block below. The intent of the table is that if they reach a certain level that is equal or greater than the ID column, the script column for that ID will be called. 
My question is, how do you call the script column in your NPC script? Wondering if this is possible, since i have a few events that will benefit this one lookup table, instead of writing each one of the rewards.

getitem 13534; getitem 14533;

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   12
  • Joined:  04/10/20
  • Last Seen:  

You can't store script commands in a string, and the only way to call data from a DB is to store it as an integer or a string. 

To get a script to perform "getitem" you need to explicitly type "getitem" into your script. 

If it's something that you use a lot of times, perhaps create a function instead of calling from the DB.

 

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...