Author Topic: Need alittle help  (Read 16636 times)

0 Members and 1 Guest are viewing this topic.

Offline JonasbengtTopic starter

  • Newbie
  • *
  • Posts: 3
  • Activity:
    0%
  • Reputation Power: 0
  • Jonasbengt has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Need alittle help
« on: September 30, 2014, 10:20:50 AM »
0
Hi there, im trying to lern/do a own script for a super easy thing. but i can find where to start, so i thought id just ask

Im looking for something like, this.

on hotkey Z
use item x
if no item of that kind then print "funny comment here"
waitforcursor/waitfor target
else wait for journal secret word
when right word said in journal
target last target.

And ofc i want this in lua for openeuo :D

If you just want to give me some hints/something to start off that would be awsome! :D


Post Merge: September 30, 2014, 12:39:07 PM
Ive looked around and ive stolen some here and there to get something going. Ive made it so that i can use the item! :D progress!

But i have no idee on how to do the journal thing, and i have no idee on how to make the script go back and wait for me to use the hotkey again. it just stopps after 1 use =(
« Last Edit: September 30, 2014, 12:39:07 PM by Jonasbengt »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Need alittle help
« Reply #1 on: October 13, 2014, 04:28:12 AM »
0
post your code
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline KaliOfLS

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Need alittle help
« Reply #2 on: May 07, 2015, 04:56:09 PM »
0
Code: [Select]



--on hot key

if getkey('z') then
    while getkey('z') do wait(1) end --have fun if you forget this. 
    UO.ScanItems(false)
    local nCnt = UO.FilterItems(2,xType)
    if nCnt < 1 print("funny messages :D :D :D LOL") else
       UO.LObjectID = UO.GetItems(0)
       UO.Macro(17,0)
       local ref,cnt = UO.ScanJournal(0)
       local timer,err = getticks()+500,3
       while not UO.TargCurs do
          if err < 1 then break 
          elseif timer < getticks() then
              UO.Macro(17,0)
              timer,err = getticks()+500,err-1
          else wait(50) end
       end
       local msg = false       
       while not msg do
           ref,cnt = UO.ScanJournal(ref)
           for i = 0, cnt-1 do
                local line = UO.GetJournal(i)
                if line:match("Secret Code!") then msg = true break end
           end   
       end
       --UO.LTargetID = sometarget or is it already set
       UO.LTargetKind = 1
       UO.Macro(22,0)
    end
end
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Tags: