Help Me tailor script

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
vinch
Posts: 2
Joined: 2004-12-27 11:12:41

Help Me tailor script

Post by vinch »

wats wrong with this script???
it says parser error line 1...

help me please

Code: Select all

*********************************** 
*     A script for Krafts     *
* (In this case for Tailoring) *
***********************************

; |---------------------------|
; | the Description of variables Items |
; |---------------------------|
9
VAR EQ, RQ1, RQ2, QB
VAR Eat = '0x097B'; Type Meal (Fish)
VAR Res1 = '0x175D'; Type the Resource 1 (Fabric)
VAR Res2 = '0x0FA0'; Type the Resource 2 (Threads)
VAR Kit = '0x0F9D'; Type the Tool krafta (Sewing Kit)
VAR Items = '0x1F03'; Type the Target material
EQ=50; Quantity of a resource 1
RQ1=150; Quantity of a resource 1
RQ2=20; Quantity of a resource 1
QB=32; Quantity of bags in ContainerBag

; |---------------------------------|
; | the Description of variable containers |
; |---------------------------------|

VAR ContainerRes = '0x0e7d'; Object the Container with resources
VAR ContainerBag = '0x0e75'; Object the Container with bags
VAR BagCount = '0x0E76'; Type bags in container ContainerBag


sub main ()
   UO.Set ('quiet', '1')
   UO.Exec (' exec Craft ')
   UO.IgnoreReset ()
end sub

sub OpenBag ()
   VAR i, BagID
   UO.UseObject (ContainerBag)
   UO.UseObject (ContainerRes)
   UO.IgnoreReset ()
   Repeat
    UO.DeleteJournal ()
    Wait (1000)
    UO.FindType (BagCount, '-1 ', ContainerBag)
    If UO.FindCount ('finditem')> 1 Then
      i = (UO.FindCount ('finditem') +1)
      UO.Click ('finditem')
      If UO.InJournal (" a bag ") Then
       BagID=UO.JournalSerial (UO.InJournal (" a bag ")-1)
       UO.SetJournalLine (UO.InJournal (" a bag ")-1, " ")
       UO.FindType (Items, '-1 ', BagID)
       UO.UseObject (BagID)
       Wait (2000)
       UO.Hide (BagID)
       UO.Ignore (BagID, 'on')
      EndIF
    EndIf
    i = (i - 1)
   Until i == 0
   UO.Hide (ContainerBag)
   UO.Hide (ContainerRes)
   UO.Resend ()
   Wait (3000)
   UO.IgnoreReset ()
end sub


sub Craft ()
VAR Last=0, LastTimer
   OpenBag ()
   While NOT UO.Dead ()

; |-----------------------------------|
; | Search of resources and Take them |
; |-----------------------------------|

    UO.FindType (Eat, '-1 ',' me ')
    If UO.GetQuantity ('finditem') <1 then
      UO.FindType (Eat, '-1 ', ContainerRes)
      If UO.GetQuantity ('finditem')> 1 then
       ToTake (3)
      Else
       UO.Exec (' Terminate Craft ')
      EndIf
    Else
      ToEat ()
    EndIf
    UO.FindType (Res1, '-1 ',' me ')
    If UO.GetQuantity ('finditem') <16 then
      UO.FindType (Res1, '-1 ', ContainerRes)
      If UO.GetQuantity ('finditem')> 1 then
       ToTake (1)
      Else
       UO.Exec (' Terminate Craft ')
      EndIf
    EndIf
    UO.FindType (Res2, '-1 ',' me ')
    If UO.GetQuantity ('finditem') <1 then
      UO.FindType (Res2, '-1 ', ContainerRes)
      If UO.GetQuantity ('finditem')> 1 then
       ToTake (2)
      Else
       UO.Exec (' Terminate Craft ')
      EndIf
    EndIf

; |-------------|
; | Craft Items |
; |-------------|

    UO.DeleteJournal ()
    UO.WaitTargetType (Res1)
    UO.UseType (Kit)
    UO.WaitMenu ('Cloth', 'Shirts','Shirts','robe '); Name E?aooIai?1 (Cloth), IiaIai?2 (Shirts)-> E?aooIai?2 (Shirts), IiaIai?2 (Robe)
    LastTimer=UO.Timer ()
    Repeat
      wait (100)
    Until UO.InJournal (" You put ") OR UO.InJournal ("Tailoring") OR LastTimer+150 <UO.Timer ()
    UnLoadItem ()
   Wend
end sub

sub ToTake (i)
VAR G, F
   If i == 1 Then
    G = RQ1
    F = Res1
   EndIf
   If i == 2 Then
    G = RQ2
    F = Res2
   EndIf
   If i == 3 Then
    G = EQ
    F = Eat
   EndIf
   UO.FindType (F, '-1 ', ContainerRes)
   if UO.GetQuantity ('finditem')> 1 then
      UO.Grab (" + str (G) + ",'finditem ')
      UO.DeleteJournal ()
    Repeat
      UO.FindType (F, '-1 ',' me ')
      Wait (1500)
    Until UO.InJournal (" That is too ") OR UO.GetQuantity ('finditem')> 1
   endif
end sub   
     
sub ToEat ()
   UO.UseType (Eat)
end sub

sub UnLoadItem ()
   VAR BagID
   VAR i=0
   VAR m=0
   Repeat
    UO.DeleteJournal ()
    UO.FindType (BagCount, '-1 ', ContainerBag)
    UO.Click ('finditem')
    m = 0
    Repeat
      Wait (1000)
    Until UO.InJournal (" a bag ")
    If UO.InJournal (" a bag ") Then
      BagID=UO.JournalSerial (UO.InJournal (" a bag ")-1)
      UO.SetJournalLine (UO.InJournal (" a bag ")-1, " ")
      UO.FindType ('-1 ', '-1 ', BagID)
      If UO.FindCount ('finditem') <220 then
       m = UO.FindCount ('finditem')
       UO.SetReceivingContainer (BagID)
       UO.FindType (Items, '-1 ',' me ')
       UO.Grab ('0', 'finditem')
       UO.ConColor ('0x0021')
       UO.Set ('quiet', '0')
       UO.Print (UO.Print (' In BagPack * ' + Str (i+1) + 'items' +Str (m) + "))   
       UO.Set ('quiet', '1')
       UO.ConColor ('0x0035')
       Wait (1000)
       UO.UnSetReceivingContainer ()
      Else
       i = i + 1
       UO.Ignore (BagID, 'on')
      EndIf
    EndIf     
    If i == QB Then
      UO.IgnoreReset ()
      i = 0
    EndIf
    UO.FindType (Items, '-1 ',' me ')
   Until UO.FindCount ('finditem') <1
end sub
JIupus
Posts: 112
Joined: 2004-12-29 15:16:45
Contact:

Post by JIupus »

try to replace that

Code: Select all

; |---------------------------|
; | the Description of variables Items |
; |---------------------------|
9

this that

Code: Select all

; |---------------------------|
; | the Description of variables Items |
; |---------------------------|
;9

and when this error will appear, try to find error in line, which number was in errormessage
Post Reply