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
Exp_GetVal: Divide by 0
Author Message
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #1
Exp_GetVal: Divide by 0
Code:
17:45:ERROR:(e_startx.scp,1079)Undefined symbol ''
17:45:ERROR:(e_startx.scp,1079)Exp_GetVal: Divide by 0

Script:
Code:
IF <SRC.ISPLAYER>
SRC.SYSMESSAGE @0487 <SRC.DTAG0.BONUSRESISTANCE_PARALYZE>% <QVAL <SRC.ACCOUNT.DTAG0.LANGUAGE>==1 ? resistance to Paralyze:сопротивления к магии Paralyze>.
ENDIF
(This post was last modified: 12-30-2012 11:51 PM by Russian.)
12-30-2012 11:50 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Exp_GetVal: Divide by 0
Try without % character.
12-31-2012 12:58 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: Exp_GetVal: Divide by 0
Your problem here is dtag0.
tag0 is to see if the tag is there.
dtag gives you the integer value of a tag
dtag0 will force an integer even if there is no tag, which causes the error because the result of the equation is too small

If there's is the possibility of that tag not existing use eval or put it inside an if statement to check it exists before running the line containing the qval.

Code:
IF <SRC.ISPLAYER>
SRC.SYSMESSAGE @0487 <SRC.DTAG0.BONUSRESISTANCE_PARALYZE>% <QVAL (<EVAL <SRC.ACCOUNT.TAG0.LANGUAGE>==1>) ? resistance to Paralyze:сопротивления к магии Paralyze>.
ENDIF

[Image: 2nis46r.jpg]
(This post was last modified: 12-31-2012 01:41 AM by Mordaunt.)
12-31-2012 01:28 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #4
RE: Exp_GetVal: Divide by 0
Shak is on the right track here. This has nothing to do with the TAG0. In fact, TAG0 is properly used in this situation.
If you look closely, there is no equations in this script, but since % is the modulus sign, an equation is created deviding <SRC.DTAG0.BONUSRESISTANCE_PARALYZE> by a string, which is a big NO NO!
You need to find a way to make % as part of the string.

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
12-31-2012 05:24 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Exp_GetVal: Divide by 0
Oddly having played with a "similar" line in a test function on my server, i don't get any kind of errors and the % is taken as part of the string and displayed in the message....

My Test:

Code:
[function 1]
src.sysmessage <src.dtag0.test>% <qval (<src.account.dtag0.test2>==1)? yes:no>

set the tags to whatever you want... the output to the screen when you do .1 is as written in the function.

As a sysmessage it is a string and displayed as such unless the variable is taken from within <>
Given that % is not within the brackets it is part of the string.
I can't see why this does not work as written, it certainly does for me

[Image: 2nis46r.jpg]
(This post was last modified: 12-31-2012 06:12 AM by Mordaunt.)
12-31-2012 05:49 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #6
RE: Exp_GetVal: Divide by 0
i think problem can be the font and %, if you add the @ font thing to the sysmessage probably it will give the same error:

PHP Code:
[function 1]
src.sysmessage @0487 <src.dtag0.test>% <qval (<src.account.dtag0.test2>==1)? yes:no
(This post was last modified: 12-31-2012 08:26 AM by Shaklaban.)
12-31-2012 08:18 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Exp_GetVal: Divide by 0
Nope... I even ran the line he has, no errors at all.

I'm thinking that he edited the mistake out of the original post. The only thing that gives me any kind of issue is the Cyrillic, I can't make that output at all, though that is likely down to regional alphabet settings on the computer running the scripts. I can't imagine every Russian server out there is unable to use their native language.

[Image: 2nis46r.jpg]
12-31-2012 08:40 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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