The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error in my insure script
Author Message
jexnico
Journeyman
*

Posts: 191
Likes Given: 114
Likes Received: 3 in 3 posts
Joined: Jan 2014
Reputation: 0



Post: #1
Error in my insure script
Someone tell me what is wrong with this script? I type the command and when I select the item to be insured of this error.
The script is used to insure an item. (Do not lose it after death)

[Image: hujfo0.png]

Quote:[DEFNAME insure_settings]
INSURANCE_PRICE 4000

[PLEVEL 1]
INSURE

[FUNCTION INSURE]
TARGETF TARGET_INSURE
SYSMESSAGE @04ec,3,1 What item would you like to insure?

[FUNCTION TARGET_INSURE]
LOCAL.TMP=<OBJ>
OBJ=<ARGO.UID>
IF (<OBJ.ATTR>&ATTR_NEWBIE)
SYSMESSAGELOC 04ec,3,1060870
ELIF (<OBJ.TOPOBJ>!=<SRC>)
SYSMESSAGELOC 04ec,3,1060871
ELIF (<SRC.TOTALGOLD> < <DEF.INSURANCE_PRICE>) || (<OBJ.ISEVENT.T_ITEM_INSURED>)
SYSMESSAGELOC 04ec,3,1060869
ELSE
OBJ.EVENTS +T_ITEM_INSURED
CONSUMEGOLD <DEF.INSURANCE_PRICE>
SYSMESSAGELOC 04ec,3,1060873
OBJ.UPDATE 1
ENDIF
OBJ=<LOCAL.TMP>

[TYPEDEF T_ITEM_INSURED]
ON=@ClientToolTip
SRC.ADDCLILOC 1061682

[EOF]
(This post was last modified: 02-18-2016 02:46 AM by jexnico.)
02-18-2016 02:44 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #2
RE: Error in my insure script
Are you sure that the cliloc in SYSMESSAGELOC is correct?
02-18-2016 03:01 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes karma's post
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #3
RE: Error in my insure script
You have TYPEDEF T_ITEM_INSURED but it is not set anywhere. Maybe you want [EVENTS T_ITEM_INSURED] instead.

Probably the cliloc is messed up, coz the script doesn't seem wrong.
02-18-2016 05:21 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes pointhz's post
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #4
RE: Error in my insure script
Try this. TargetF doesn't need obj.
src = <person who called trigger>
argo = targeted whatevers UID. The UID though is called like uid.<argo>.key
local.id = targeted items ID. (Can't remember if it is baseid or dispid (so I checked argo instead local.id))

Code:
[FUNCTION TARGET_INSURE]
IF (<uid.<argo>.ATTR>&ATTR_NEWBIE)
SYSMESSAGELOC 04ec,3,1060870
ELIF (<uid.<argo>.TOPOBJ>!=<SRC>)
SYSMESSAGELOC 04ec,3,1060871
ELIF (<SRC.TOTALGOLD> < <DEF.INSURANCE_PRICE>) || (<uid.<argo>.ISEVENT.T_ITEM_INSURED>)
SYSMESSAGELOC 04ec,3,1060869
ELSE
uid.<argo>.EVENTS +T_ITEM_INSURED
src.CONSUMEGOLD <DEF.INSURANCE_PRICE>
SYSMESSAGELOC 04ec,3,1060873
uid.<argo>.UPDATE 1
ENDIF

Otherwise, you were doing the right things. I checked your clilocs and they are right. Obj and local.tmp were far from needed.
(This post was last modified: 02-18-2016 07:49 AM by Khaos.)
02-18-2016 07:46 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Khaos's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)