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
IF ON bag ON pack question
Author Message
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #1
IF ON bag ON pack question
Hi! I have a simple question here Tongue
I want to take a simple IF.

IF it is in your pack
and if it is in a bag in your pack Tongue

it's just to use some items in packs in your bags too ^_^ because if I use something like:

Code:
IF <CONT.UID>!=<SRC.FINDLAYER(21).UID>

or
Code:
IF <SRC.TARG.CONT.UID>==<SRC.findlayer(layer_pack).UID>

The item needs to be in your pack only and not in others bags or something else in your pack ^_^

Thanks!

Lazarus.

[Image: 2hy9q0y.png]
(This post was last modified: 12-04-2012 05:21 PM by Lazarus.)
12-04-2012 05:20 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: IF ON bag ON pack question
What about FORCONTID ?

[FUNCTION rem_spellbooks2]
FORCONTID i_spellbook 10 // number of subcontainer inside backpack
blabla
ENDFOR
12-04-2012 07:36 PM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #3
RE: IF ON bag ON pack question
(12-04-2012 07:36 PM)darksun84 Wrote:  What about FORCONTID ?

[FUNCTION rem_spellbooks2]
FORCONTID i_spellbook 10 // number of subcontainer inside backpack
blabla
ENDFOR

I want in a DCLICK script, like if you are using that item, you must have the item in the pack or in a pack on the pack Tongue not in the ground ^_^

[Image: 2hy9q0y.png]
12-05-2012 03:50 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #4
RE: IF ON bag ON pack question
you already know the item uid you wanna check?
12-05-2012 03:53 AM
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: IF ON bag ON pack question
The wiki is your friend

Quote:TOPOBJ If an object is buried in several containers within containers, this is always the top-level container before you get to the world. If an item is buried in a player's backpack, TOPOBJ is the player.

[Image: 2nis46r.jpg]
12-05-2012 04:09 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #6
RE: IF ON bag ON pack question
@Mordaunt
If i understood what he wants topobj wont gonna help, cuz topobj would be always the char...
(This post was last modified: 12-05-2012 08:03 AM by ChaveS.)
12-05-2012 08:02 AM
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: IF ON bag ON pack question
and you can't find layer_backpack on a character?.....

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

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #8
RE: IF ON bag ON pack question
(12-05-2012 08:05 AM)Mordaunt Wrote:  and you can't find layer_backpack on a character?.....

Like
Code:
IF (<SRC.TARG.TOPOBJ.UID>==<SRC.UID>)
?

thanks, I will search in some scripts if I find more topobj and try to use it ^_^

Oh I have it!

IF (<TOPOBJ.UID>!=<SRC>) Smile

Thanks for all Mordaunt, chaves and darksun ♥

[Image: 2hy9q0y.png]
(This post was last modified: 12-05-2012 09:09 AM by Lazarus.)
12-05-2012 08:58 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
ChaveS
Journeyman
*

Posts: 69
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #9
RE: IF ON bag ON pack question
@Lazarus
This isn't supposed to work

If you already know the item is in somewhere his backpack, you can simply use

if (<cont.layer> != 21)
src.message <name> is in some container inside my bag
endif
(This post was last modified: 12-05-2012 01:14 PM by ChaveS.)
12-05-2012 01:13 PM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #10
RE: IF ON bag ON pack question
(12-05-2012 01:13 PM)ChaveS Wrote:  @Lazarus
This isn't supposed to work

If you already know the item is in somewhere his backpack, you can simply use

if (<cont.layer> != 21)
src.message <name> is in some container inside my bag
endif

This was work:

[function OUTPACK]
IF (<TOPOBJ.UID>!=<SRC>) || (<CONT.UID>==<SRC.FINDLAYER.LAYER_BANKBOX.UID>)
SRC.SYSMESSAGE The item must be in your pack!
RETURN 1
ELSE
RETURN 0
ENDIF


when i call it in a function i use:

ON=@DCLICK
IF !<OUTPACK>
SRC.MESSAGE
TARGET
XXXX
ELSE
RETURN 1
ENDIF

^_^

[Image: 2hy9q0y.png]
12-07-2012 01:55 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: 3 Guest(s)