Total players online: 10



Take the Tour | Site Map

It is currently Sat Sep 22, 2018 8:35 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: finditem
PostPosted: Tue Jun 12, 2007 11:40 am 
Online
Adept Scripter
Adept Scripter

Joined: 02/22/2005 11:32
Posts: 159

Groups:
hello !
in my backpack there are many objects with type ZLM, but i want to make, that script choses one of all objects and use it !
Thank you.


Top
  Profile 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:04 pm 
Offline
Legendary Scripter
Legendary Scripter

Joined: 04/27/2004 23:29
Posts: 1649

  1. Finditem ZLM C_ , #backpackid  ; <-- finds all items
  2. if #findcnt > 0 ; <- found at least 1?
  3. {
  4.    set #LOBJECTID #findid ; <-- we use the first one we found
  5.    event macro 17 0 ; <- use last object
  6. }

hope it helps.

_________________
Visit My PSL


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:05 pm 
Online
Adept Scripter
Adept Scripter

Joined: 02/22/2005 11:32
Posts: 159

Groups:
thanks :)


Top
  Profile 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:11 pm 
Offline
This user has been...
User avatar

Joined: 11/20/2005 02:27
Posts: 1623

what is ZLM (I thought it was runebook :oops: but database says 'paralyze')

you want to use one at random?

What it IS makes a difference on how to use it

basic level would be (not tried it and maybe out of practice)

  1. {
  2.    event macro 17
  3.  
  4.    ;after that is totally depends upon what ZLM is
  5.  
  6. }


[edit] I just made less assumptions than Aganor - we were writing at same time :)

if ZLM were a paralyze scroll the event macro 17 would not be enough to do much.... target and engage stages....

_________________
My PSL scripts / (non-PSL)


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:19 pm 
Online
Adept Scripter
Adept Scripter

Joined: 02/22/2005 11:32
Posts: 159

Groups:
ZLM was only like an example :oops: :)

alright, i don't want to make a new topic so i will write here.
On shard where i play, i have a fishing script.

Code:
  1. set %pole XHF
  2. set %fish DQD_EQD_FQD_GQD_ZLK_JJK_CUD
  3. set %somabanka BGWCLMD
  4. moving:
  5. msg back $
  6. wait 14s
  7. gosub fishing
  8. msg back$
  9. wait 14s
  10. gosub fishing
  11. msg back $
  12. wait 14s
  13. gosub fishing
  14. msg forward$
  15. wait 45s
  16. gosub fishing
  17. wait 1s
  18. goto moving
  19. sub fishing
  20. for %xx -5 5
  21. {
  22. for %yy -5 5
  23. {
  24. finditem %pole
  25. gosub proverka
  26. }
  27. }
  28. sub proverka
  29. set %overtime #SCNT + 15
  30. loop:
  31. {
  32. msg .arm $
  33. wait 20s
  34. wait 10
  35. wait 7s
  36. }
  37. if you_fail in #sysmsg
  38. {
  39. {
  40.    event macro 17 0
  41. }
  42. {
  43.    event macro 17 0
  44. }
  45. }
  46. if you_gained in #sysmsg
  47. if There_are_no_ in #JOURNAL || Try_fishing_ in #JOURNAL || That_is_too in #JOURNAL || You_fail_to_catch_ in #JOURNAL || Fishing_has in #JOURNAL || #SCNT >= %overtime
  48. if You_pull in #JOURNAL || seconds_before in #JOURNAL
  49. {
  50. gosub drag
  51. }
  52. goto loop
  53. sub drag
  54. finditem %fish G_1
  55. exevent dropc %somabanka
  56. finditem %fish G_1
  57. exevent dropc %somabanka


But if i wish something better not a fish, example transport, script stops, because there was no message in #sysmsg. How to fix this ?


Top
  Profile 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:37 pm 
Offline
Legendary Scripter
Legendary Scripter

Joined: 04/27/2004 23:29
Posts: 1649

Well, I'd gladly help you, but didn't understand your request...

_________________
Visit My PSL


Top
  ProfileShow poster's scripts in the public script library 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:40 pm 
Online
Adept Scripter
Adept Scripter

Joined: 02/22/2005 11:32
Posts: 159

Groups:
well, if i pull out a simple fish, in #sysmsg appears msg : you pull out a fish!
but if i pull out example a transport, then there are no msg in #sysmsg and scp stops.


Top
  Profile 
 Post subject: Re: finditem
PostPosted: Tue Jun 12, 2007 12:48 pm 
Offline
Legendary Scripter
Legendary Scripter

Joined: 04/27/2004 23:29
Posts: 1649

well, you can simply add a timeout value.

Try something along those lines :

Code:
  1. set #LOBJECTID %fishingpole
  2. target 5s ; <-- waits for a target cursor max 5s
  3. if #TARGCURS = 1 ; if not, no need to do the rest
  4. {
  5.    event macro 22 0
  6.    set %timeout #sCnt2 + 95 ; <- 9,5 seconds
  7.    set %journal #jindex
  8.    while %timeout > #sCnt2
  9.    {
  10.       for %line %journal #jindex
  11.       {
  12.            scanjournal %line
  13.            if pull_out in #journal
  14.            {
  15.               set %timeout #sCnt2 - 1
  16.            }
  17.       }
  18.    }
  19. }

_________________
Visit My PSL


Top
  ProfileShow poster's scripts in the public script library 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: rtojettbeelibe and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.