Author Topic: My first scrip and need help seting it up  (Read 11202 times)

0 Members and 1 Guest are viewing this topic.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #15 on: August 18, 2011, 01:33:53 PM »
0
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

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: My first scrip and need help seting it up
« Reply #16 on: August 18, 2011, 01:54:39 PM »
0
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0
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 Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: My first scrip and need help seting it up
« Reply #17 on: August 18, 2011, 03:02:04 PM »
0
You don't need to set the target cursor, when you use the pole it will automatically set to 1.

You just need to put the line

Target 3s

after the event macro 17 so the script waits till the target cursor comes up.
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: My first scrip and need help seting it up
« Reply #18 on: August 18, 2011, 03:31:45 PM »
0
You don't need to set the target cursor, when you use the pole it will automatically set to 1.

You just need to put the line

Target 3s

after the event macro 17 so the script waits till the target cursor comes up.
But Maximum will wait 3 Seconds.
if you want infinite waiting use Target

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #19 on: August 18, 2011, 04:08:15 PM »
0
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0

I have read what i think i was suppost to read what i read was

Drop Item on the Ground Around you  (non stacking)

Returns true or false for success or fail.  trys every spot around your character

Code: [Select]
Sub ENs_DropOnGround ; %itemid %BagFrom %DropRadius
  set %Item %1
  IF %0 <= 1
    set %2
  set %BagFrom %2
  IF %0 <= 2
    set %3 2
  set %DropRadius %3
 
  Set %XPos ( #CharPosX - %DropRadius )
  Set %YPos ( #CharPosY - %DropRadius )
  Set %DropExit #False
  Repeat
    wait 10
    FindItem %item C_ , %BagFrom
    wait 3
    If #FindKind = -1
      Set %DropExit #True
    IF %DropExit = #False
      {
      ;event ExMsg #charID 3 0 trying %xpos %ypos
      ExEvent Drag #findid #Findstack
      Wait 12
      ExEvent DropG %Xpos %YPos
   
      ; Increment Position
      Set %XPos ( %XPos + 1 )
      If %Xpos > ( #CharPosX + %DropRadius )
        {
        Set %YPos ( %YPos + 1 )
        Set %XPos ( #CharPosX - %DropRadius )
        }
      }
  Until %DropExit || %YPos > ( #CharPosY + %DropRadius )
Return %DropExit

but i do not understand it can someone explain how this works?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #20 on: August 18, 2011, 04:26:38 PM »
0
I have figured out how to move items but i cannot figure out how to drop them where i want to drop them.
Also if there is more than one item i want to check for like i caught a fish and a pear i just have the script go though a line of checks?
And how do I search the ground for a dead monster then open it and search for an item?
« Last Edit: August 18, 2011, 04:33:10 PM by NecroFox »
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: My first scrip and need help seting it up
« Reply #21 on: August 18, 2011, 05:23:29 PM »
0
look in the documentation for exevent drag and exevent dropc
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

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: My first scrip and need help seting it up
« Reply #22 on: August 18, 2011, 05:34:05 PM »
0
Figured it out lol

now i am going eat when i get back i will atempt to figure out how to drag and drop items into the hold


Some of my code snippets may prove usefull for you....  thier are several move subs listed...
http://www.scriptuo.com/index.php?topic=2454.0

I have read what i think i was suppost to read what i read was

Drop Item on the Ground Around you  (non stacking)

Returns true or false for success or fail.  trys every spot around your character

Code: [Select]
Sub ENs_DropOnGround ; %itemid %BagFrom %DropRadius
  set %Item %1
  IF %0 <= 1
    set %2
  set %BagFrom %2
  IF %0 <= 2
    set %3 2
  set %DropRadius %3
 
  Set %XPos ( #CharPosX - %DropRadius )
  Set %YPos ( #CharPosY - %DropRadius )
  Set %DropExit #False
  Repeat
    wait 10
    FindItem %item C_ , %BagFrom
    wait 3
    If #FindKind = -1
      Set %DropExit #True
    IF %DropExit = #False
      {
      ;event ExMsg #charID 3 0 trying %xpos %ypos
      ExEvent Drag #findid #Findstack
      Wait 12
      ExEvent DropG %Xpos %YPos
   
      ; Increment Position
      Set %XPos ( %XPos + 1 )
      If %Xpos > ( #CharPosX + %DropRadius )
        {
        Set %YPos ( %YPos + 1 )
        Set %XPos ( #CharPosX - %DropRadius )
        }
      }
  Until %DropExit || %YPos > ( #CharPosY + %DropRadius )
Return %DropExit

but i do not understand it can someone explain how this works?


Well if you wanted to drop on the ground sure... but you want to drop in the hold which like your backpack and bankbox is actually a containor

So a more appropriate sub would be the last one ENs MoveToContainor  >... But perhaps subs are to advanced for you at this stange in which case read up on exevent drag/drop like cerveza sugggested.

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 NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #23 on: August 18, 2011, 07:23:36 PM »
0
Ok i have read both the event drag and exevent drop but i do not understand it. i took a pearl out of my hold and put it in my bag and made a new script so it will be easer to chang till it works then copy and past to the real one but all it does it just picks up the pearl and i still cannot get it to drop where the cargo hold is help please

Set %White_Pearl WWS_
Set %Cargo_Hold XZCC_

FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0
exevent drag #lobjectid
wait 20
exevent dropc %Cargo_Hold
Halt
« Last Edit: August 18, 2011, 09:23:07 PM by NecroFox »
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: My first scrip and need help seting it up
« Reply #24 on: August 19, 2011, 12:09:22 AM »
0
Code: [Select]
Finditem %Whitepearls C , #backpackID
;Find Items of Type\ID %Whitepearls in Container "BackpackID"
if #findkind <> -1
;If Searched ID\Types exist
{
;Open if Command and only will execute Code when the if is true
Exevent drag #findid #findstack
;Grab the foundet Result ID and the Amount of its Stack
wait 5
;This Command has a small Timeout given from Server
Exevent dropc %Cargo_Hold
;Let it fall down into a Container with name %Cargo_Hold
wait 5
;This Command has a small Timeout given from Server
}
;Close If Command
Under Each Line is outcommented Comments what the Line above do.About the waits: it doesnt matter if you wait after Drag & Drop or Drag wait Drop wait.But the Server has a timeout,if you interact faster it will block your action.
You must think about Easyuo interact as a Queue and a stupid robot.
when you making Code it will run from first until last line and will only do what u show him to.
If you want to let your robot grab something you must him show how he can find to get it,because when u say "Give me this" he dont know what is this and you must specific it.What he need to grab and how many\much of it and where to go to drop
Now about the Queue:
Some Commands have a specific "How to do Rule" to work succesfully.
Example:
  • You can only Drop something if you dragged before
  • Using specific ID as LastObject via define it and then use the Event
  • Using specific ID as LastTarget via define it and then use the Event
  • To use and Target an ID you need first let your char use LastObject and then Target on a Target
  • The world using 3 Layers: Ground, Normal and Air so you must change the #LTargetkind depending on the Action you want with LObject and LTarget


Now we will analyze your Code:
Code: [Select]
FindItem %White_Pearl C_, #backpackID
;Trying to Scan for %White_Pearl in Container "BackpackID"
set #lobjectID #findID
;Sets a Lobject as #FindID, if your Scan find nothing you will have nothing in
if #FINDCNT > 0
;Oh cool an if Command
exevent drag #lobjectid
;Where is your Stack? with that he will drag and drop 1 item part by part. If you would have 200 Whitepearls it would loot only 1
wait 20
;Long wait but how you wait after drop?
exevent dropc %Cargo_Hold
;This is fine...
Halt

Hope it helps..

Crome

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #25 on: August 19, 2011, 12:14:42 AM »
0
Ok well i figured it out
Now i need to learn how to get a script to check for the message to determan if i caught a fish, schale, shoe, serpant, pearl or a big fish
what should i read up on to get that infomation?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: My first scrip and need help seting it up
« Reply #26 on: August 19, 2011, 12:30:07 AM »
0
Ok well i figured it out
Now i need to learn how to get a script to check for the message to determan if i caught a fish, schale, shoe, serpant, pearl or a big fish
what should i read up on to get that infomation?
You could try to scan the Journal and ask if %Message is in Journal" or you just could determine the Types of items u want stack in Boat in "List A" and determine Items you wanna throw in "List B"
than Scan for List A if something found drop it in your cargo else Scan for List B if something found drop on Ground. Easyiest way.

Crome

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +38
  • Referrals: 0
    • View Profile
Re: My first scrip and need help seting it up
« Reply #27 on: August 19, 2011, 12:50:55 AM »
0
example for journal scan, it will loop until you get the message that you need or there has been a timeout(20s) .
Code: [Select]
set %timer_tame #sCnt
; --------------------
; do whatever you have to do before scaning journal
;---------------------
      set %_jindex #jindex ; this sets up the line to begin scan from
      set %exit #false
      set %timer_tame ( #sCnt + 20 )
      repeat
        {
          if #jindex >= %_jindex
          {
            scanjournal %_jindex
            if you_fail in #journal || seems_to_accept in #journal || too_far_away in #journal || anger in #journal || clear_path in #journal || #sCnt >= %timer_tame
              set %exit #TRUE
            set %_jindex %_jindex + 1
          }
          wait 0
        }
      until %exit #TRUE
; --------------------
; do whatever you have to do after journal scaning has been done
; --------------------
What you witness -- is whatver..
uogamers hybrid.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: My first scrip and need help seting it up
« Reply #28 on: August 19, 2011, 02:40:23 AM »
0
Something you have to know about "condition" statements like if...

if something ; will execute either the very next line or everything inside {}

Code: [Select]
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0
exevent drag #lobjectid
wait 20
exevent dropc %Cargo_Hold
Halt

if #findCnt > 0 ; ok, if there are more then 0 of them execute THE NEXT LINE
; if there are 0 of them then SKIP THE NEXT LINE

see if you have 0 in your pack then it skips over the drag line and does the wait line. How about changing it to this:

FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
if #FINDCNT > 0 ; if the condition is true perform the NEXT LINE or what's within the {}
{
exevent drag #lobjectid
exevent dropc %Cargo_Hold
wait 20 ; I arranged this for you
}
Halt ; if more then 0 then do the stuff in {}, if 0 is found then skip that and wind up here
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #29 on: August 19, 2011, 03:10:27 AM »
0
i figured it out last night but the way i coded it looks different it looks like

Code: [Select]
FindItem %White_Pearl C_, #backpackID
set #lobjectID #findID
exevent drag #lobjectid
wait 20
FindItem %Cargo_Hold G_3
exevent dropc #Findid
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Tags: