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
easier way?
Author Message
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
easier way?
Code:
[REGIONTYPE r_britain]
ON=@ENTER
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<UID.040004100.LINK>==01000)//shan
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004000) && (<UID.040004100.LINK>==01000)//shan
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004000>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//wu
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) && (<UID.040004100.LINK>==01001)//graham
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004001) && (<UID.040004100.LINK>==01001)//graham
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004001>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//shu
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) && (<UID.040004100.LINK>==01002)//rhast
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004002) && (<UID.040004100.LINK>==01002)//rhast
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004002>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//ys
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) && (<UID.040004100.LINK>==01003)//mulldawg
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004003) && (<UID.040004100.LINK>==01003)//mulldawg
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004003>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//lb
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004004) && (<UID.040004100.LINK>==01004)//warchild
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004004) && (<UID.040004100.LINK>==01004)//warchild
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004004>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//yt
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004005) && (<UID.040004100.LINK>==01005)//jerico
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004004) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004005) && (<UID.040004100.LINK>==01005)//jerico
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004005>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
//mh
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004006) && (<UID.040004100.LINK>==01006)//spanky
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004004) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004005) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004006) && (<UID.040004100.LINK>==01006)//spanky
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004006>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004007) && (<UID.040004100.LINK>==01007)//darkstarr
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004004) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004005) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004006) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004007) && (<UID.040004100.LINK>==01007)//darkstarr
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004007>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004008) && (<UID.040004100.LINK>==01008)//gfresh
SRC.SYSMESSAGE There's no place like home...
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004001) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004002) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004003) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004004) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004005) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004006) || (<SRC.MEMORYFINDTYPE.0400.LINK>==040004007) || (<SRC.MEMORYFINDTYPE.0400.LINK>>040004008) && (<UID.040004100.LINK>==01008)//gfresh
SRC.SYSMESSAGE You are in enemy territory...
REF1 = <UID.040004008>
REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <UID.040004100.NAME>.
RETURN 0
ENDIF

Dragons of Time 2000-2020
http://dragonsoftime.com
05-30-2017 06:50 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: easier way?
all these numbers seems to follow the same logic, so instead write the same logic many times, you can replace it with just a single logic that is valid for all values

I have no idea if this is correct because I don't know the rest of the code

Code:
[REGIONTYPE r_britain]
ON=@Enter
IF (<SRC.GUILD>)
  REF1=040004100
  REF2=<eval <REF1.LINK>+040003000>
  IF (<SRC.GUILD.LINK>==<REF2>)
    SRC.SYSMESSAGE There's no place like home...
  ELSE
    SRC.SYSMESSAGE You are in enemy territory...
    REF2.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <REF1.NAME>.
  ENDIF
ENDIF
05-30-2017 01:05 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #3
RE: easier way?
that is the whole code...

IF (<SRC.MEMORYFINDTYPE.0400.LINK>==040004000) && (<UID.040004100.LINK>==01000)//shan

is your guildstone owner and you the town owner the same

if not, you are in enemy territory and it warns the guild who owns the town


040004000
040004001
040004002
040004003
040004004
040004005
040004006
040004007
040004008
are the guildstone IDs

01000
01001
01002
01003
01004
01005
01006
01007
01008
are the guildstone owners IDs


[REGIONTYPE r_britain]
040004100 is the townstone in brit
[REGIONTYPE r_yew]
040004101 is the townstone in yew
[REGIONTYPE r_cove]
040004102 is the townstone in cove
ect...


the townstones link is the guildmasters id, who owns the town

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 05-31-2017 01:23 AM by x77x.)
05-30-2017 04:58 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: easier way?
yes that's what I thought
all these numbers follow the same logic of "base value" + x

using an random number as example, 2 is the cove guild, so cove guildstone will be 040004000 + 2 and cove owner is 01000 + 2

with just these 2 values you can check if the player is on cove guild, if the player is on home/enemy territory, etc
05-31-2017 04:24 AM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #5
RE: easier way?
this?

Code:
[REGIONTYPE r_britain]//040004100 brit townstone
ON=@Enter
IF (<SRC.GUILD>)
  REF1=<UID.040004100.LINK>
  REF2=<UID.040004100>
  IF (<SRC.MEMORYFINDTYPE.0400.LINK>==<REF1>)
    SRC.SYSMESSAGE There's no place like home...
  ELSEIF !(<SRC.MEMORYFINDTYPE.0400.LINK>==<REF1>)
    SRC.SYSMESSAGE You are in enemy territory...
    REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <REF2.NAME>.
  ENDIF
ENDIF

or this?

Code:
[REGIONTYPE r_britain]//040004100 brit townstone
ON=@Enter
IF (<SRC.GUILD>)
  REF1=<UID.040004100>
  IF (<SRC.MEMORYFINDTYPE.0400.LINK>==<REF1.LINK>)
    SRC.SYSMESSAGE There's no place like home...
  ELSEIF !(<SRC.MEMORYFINDTYPE.0400.LINK>==<REF1.LINK>)
    SRC.SYSMESSAGE You are in enemy territory...
    REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <REF1.NAME>.
  ENDIF
ENDIF

just have to change the townstone link to the guild owners uid =)

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 05-31-2017 12:54 PM by x77x.)
05-31-2017 11:07 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #6
RE: easier way?
both seems to be the same thing and can be optimized:

Code:
[REGIONTYPE r_britain]
ON=@Enter
IF (<SRC.GUILD>)
  REF1=040004100  //brit townstone
  IF (<SRC.GUILD.LINK>==<REF1.LINK>)
    SRC.SYSMESSAGE There's no place like home...
  ELSE
    SRC.SYSMESSAGE You are in enemy territory...
    REF1.ALLMEMBERS -1,SYSMESSAGE @090 An enemy soldier has been spotted in <REF1.NAME>.
  ENDIF
ENDIF

I don't know if on your server ppl can have guildstones linked to this townstone, or if the player guild is already the townstone. This code seems to work on both cases, but if the player guild is already the townstone, you can skip these LINK checks replacing (<SRC.GUILD.LINK>==<REF1.LINK>) with (<SRC.GUILD>==<REF1>)

PS: <MEMORYFINDTYPE.0400> = <MEMORYFINDTYPE.memory_guild> = <GUILD>
06-01-2017 05:29 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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