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-nmm6 (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-nmm6 (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-nmm6 (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
first letter in the string
Author Message
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #1
first letter in the string
Hello. How i can ignore first letter in the string? For example string "12345", but i want "2345" ?
And how i can make npc follow other npc by script?
(This post was last modified: 04-21-2012 08:04 PM by Art.)
04-21-2012 07:56 PM
Find all posts by this user Like Post Quote this message in a reply
Reflex
Journeyman
*

Posts: 130
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Apr 2012
Reputation: 1



Post: #2
RE: first letter in the string
STRSUB will do this you can learn more about strings @ http://wiki.sphere.torfo.org/index.php/C..._10#STRSUB

Example from my Bank Check

Code:
ON=check*
IF (!(<ISEMPTY <STREAT <ARGS>>>))
    IF (!(<ISNUM <STREAT <ARGS>>>))
    SAY @946,3,1 You must say a value for your check.
    ELSE
        LOCAL.VALUE=<STREAT <ARGS>>
        IF (<LOCAL.VALUE> > 10000000)
        SAY @,,2 1010007
        ELIF (<LOCAL.VALUE> < 10000)
        SAY @,,2 500383
        ELIF (<SRC.GOLD> < <LOCAL.VALUE>)
        SAY @,,2 500380
// ^^ Checks for the Check
        ELIF (<LOCAL.VALUE> >= 10000) && (<LOCAL.VALUE> <= 99999)
        LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 999999)
        LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 9999999)
        LOCAL.NEWHALF=<STRSUB 0 1 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 1 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF3=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
// Amount check so we know where to place comma
        ELIF (<LOCAL.VALUE> == 10000000)
        LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
        LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
        LOCAL.NEWHALF3=,<STRSUB 3 3 <dLOCAL.VALUE>>
        SERV.NEWITEM=i_check
        NEW.TAG0.GOLDVALUE=<LOCAL.VALUE>
        NEW.NAME=Check [<dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>]
        NEW.BOUNCE
        SRC.GOLD -=<LOCAL.VALUE>
        SRC.SYSMESSAGELOC -1,1042765,<dLOCAL.VALUE>
// incase i forgot something..
        ELSE
        SAY @946,3,1 A check must be made in the amount between 10,000 and 10,000,000 Gold.
        ENDIF
    ENDIF
ENDIF
04-21-2012 08:43 PM
Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: first letter in the string
Thanks You!

What about second question? "And how i can make npc follow other npc by script?"
04-21-2012 11:56 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: #4
RE: first letter in the string
im using homedist for making npc follow other players (idea from anarch cassius). just periodically set home of npc to players position with timerf or little memory item.
04-22-2012 05:11 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)