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
Add to the NEXT Spot
Author Message
x77x
Master
**

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



Post: #1
Add to the NEXT Spot
how can i add to the NEXT open spot?

GSLAIN01 - GSLAIN250


Code:
[EVENTS e_cao_cao]
on=@deathcorpse
ref1=<attacker.max>//who ever did most damage
for x 1 250
IF (STRCMPI("<ref1.tag.gslain<LOCAL.X>>","Cao Cao")==0)
ref1.sysmessage @0482 You have already defeated General Cao Cao...
else
if <ref1.isplayer>//if max damage doner is player.
ref1.tag.gslain<dlocal._for> Cao Cao
ref1.sysmessage @0481 Congratulations! You have defeated General Cao Cao!
ENDFOR
endif


it keeps adding to GSLAIN0


thx

Dragons of Time 2000-2020
http://dragonsoftime.com
01-31-2015 05:10 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: Add to the NEXT Spot
If Endif
For Endfor

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
01-31-2015 05:55 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: #3
RE: Add to the NEXT Spot
english please?


top part works, bottom does not

always overwrites to GSLAIN0

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-31-2015 06:35 AM by x77x.)
01-31-2015 06:34 AM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #4
RE: Add to the NEXT Spot
[EVENTS e_cao_cao]
on=@deathcorpse
ref1=<attacker.max>//who ever did most damage
for x 1 250
IF (STRCMPI("<ref1.tag.gslain<LOCAL.X>>","Cao Cao")==0)
ref1.sysmessage @0482 You have already defeated General Cao Cao...
else
if <ref1.isplayer>//if max damage doner is player.
ref1.tag.gslain<dlocal._for> Cao Cao
ref1.sysmessage @0481 Congratulations! You have defeated General Cao Cao!
endif
ENDFOR -----------------> close if before for
01-31-2015 08:58 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: Add to the NEXT Spot
i did that already and its the same...

still saves to gslain0

if glsain01
and gslain02 are taken, put it at gslain03
ect...

get what im saying?


Code:
[EVENTS e_cao_cao]
on=@deathcorpse
ref1=<attacker.max>//who ever did most damage
for x 1 250
IF (STRCMPI("<ref1.tag.gslain<LOCAL.X>>","Cao Cao")==0)
ref1.sysmessage @0482 You have already defeated General Cao Cao...
else
IF <ref1.isplayer>//if max damage doner is player.
ref1.tag.gslain<dLOCAL.X> Cao Cao//<dlocal._for>
ref1.sysmessage @0481 Congratulations! You have defeated General Cao Cao!
endif
ENDFOR

i tried this and it keeps saving to GSLAIN1

i want to to find the next empty one

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 01-31-2015 12:19 PM by x77x.)
01-31-2015 12:10 PM
Find all posts by this user Like Post Quote this message in a reply
azmanomer
Journeyman
*

Posts: 139
Likes Given: 4
Likes Received: 18 in 16 posts
Joined: Nov 2013
Reputation: 1



Post: #6
RE: Add to the NEXT Spot
try to use elseif
01-31-2015 01:31 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: #7
RE: Add to the NEXT Spot
nope...

this added it 250 times =/

Code:
[EVENTS e_cao_cao]
on=@deathcorpse
ref1=<attacker.max>//who ever did most damage
for x 1 250
IF (STRCMPI("<ref1.tag.gslain<LOCAL.X>>","Cao Cao")==0)
ref1.sysmessage @0482 You have already defeated General Cao Cao...
elseif <ref1.isplayer>//if max damage doner is player.
ref1.tag.gslain<dLOCAL.X> Cao Cao//<dlocal._for>
ref1.sysmessage @0481 Congratulations! You have defeated General Cao Cao!
endif
ENDFOR

Dragons of Time 2000-2020
http://dragonsoftime.com
01-31-2015 01:44 PM
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: #8
RE: Add to the NEXT Spot
what a mess... try this.

[EVENTS e_cao_cao]
on=@deathcorpse
ref1=<attacker.max>
for x 1 250
IF (STRCMP("<ref1.tag.gslain<dLOCAL.X>>","Cao Cao")==0)
ref1.sysmessage @0482 You have already defeated General Cao Cao...
return 1
elseif (<ref1.isplayer> && <ISEMPTY <ref1.tag.gslain<dLOCAL.X>>>)
ref1.tag.gslain<dLOCAL.X> Cao Cao
ref1.sysmessage @0481 Congratulations! You have defeated General Cao Cao!
return 1
endif
ENDFOR

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
01-31-2015 11:51 PM
Visit this user's website 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: #9
RE: Add to the NEXT Spot
ISEMPTY!!!!???

nice...

BEN IS MY HERO... again...

thank you

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 02-01-2015 02:48 AM by x77x.)
02-01-2015 02:44 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: #10
RE: Add to the NEXT Spot
you must use "return 0/1" to stop the loop, otherwise it will continue looping until 250 and will set 250 tags Tongue
and also use the right return 0/1, because on @DeathCorpse the return 1 will prevent the corpse creation, and return 0 will allow the corpse creation

and LOCAL.X (hex) is not the same as dLOCAL.X (dec)
tag.gslain<LOCAL.X> = tag.gslain01
tag.gslain<dLOCAL.X> = tag.gslain1

so if you set the value on tag.gslain1, you wont find the tag value if you search it on tag.gslain01

Ben already post a working example with these things fixed

PS: just a code optimization tip, avoid make checks inside loops which doesn't really need to be inside the loop. If you check the <REF1.ISPLAYER> value inside the loop, sphere will try to get the <REF1.ISPLAYER> result 1x ~ 250x, but you just need check it 1x and not 250x. So you can check it just a single time before start the loop

Code:
[EVENTS e_cao_cao]
ON=@DeathCorpse
REF1=<ATTACKER.MAX>  //who ever did most damage
IF (<REF1.ISPLAYER>)
  FOR x 1 250
    IF (STRCMPI("<REF1.TAG.gslain<dLOCAL.X>>","Cao Cao")==0)
      REF1.SYSMESSAGE @0482 You have already defeated General Cao Cao...
      return 1  //prevent corpse creation
    ELIF (<ISEMPTY <REF1.TAG.gslain<dLOCAL.X>>>)
      REF1.TAG.gslain<dLOCAL.X>=Cao Cao
      REF1.SYSMESSAGE @0481 Congratulations! You have defeated General Cao Cao!
      return 0  //allow corpse creation
    ENDIF
  ENDFOR
ENDIF
(This post was last modified: 02-02-2015 02:47 PM by Coruja.)
02-02-2015 02:42 PM
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)