This is my script to bolt quest it heartwood.
He have next errors, mb someone can help me fix it.
1 - on toogle quest item (bolts) on simple click - he clicking as drag click.
2 - after toogling item, npc give a gump, but he don't wanna click on buttons, how fix it?
MainLoop: //main
set %screenydisp 0
set %checksum 0
set %cont 0
if #contName = generic_gump //if gump now active, close it
{
contpos 0 0
click 346 400 x 2 f
wait 11
contpos 0 0
click 346 400
wait 10
return
}
;gosub ToogleQuestItem
gosub CheckQuest
sub CheckQuest // check for the quest.
set %npc BEUIB
finditem %npc
wait 5
gosub GetScreenXY #findx #findy #findz 0 %screenydisp
wait 5
if #contName <> generic_gump
{
goto MainLoop
}
else
{
if %cont >= 1 //its calls after toogling quest item for complete quest
{
wait 10
contpos 0 0
click 133 400 x 3 f
wait 10
contpos 0 0
click 133 400 x 3 f
wait 10
if You_recive_a_reward in #sysmsg || You_recive_a_reward in #journal
{
set %cont 0
goto MainLoop
}
else
{
gosub CheckQuest
return
}
}
else
{
wait 10
contpos 0 0
gosub CheckSub
return
}
}
return
  sub GetScreenXY //for click on npc
      set %1 ( %1 - #charposx ) * 22 ; world x-coordinate
      set %2 ( #charposy - %2 ) * 22 ; world y-coordinate
      set %3 ( %3 - #charposz ) * 4  ; world z-coordinate
      if %0 < 4 || %4 = N/A
          set %4 0                   ; x displacement, added to screen coordinate
      if %0 < 5 || %5 = N/A
          set %5 35                  ; y displacement, added to screen coordinate
      set %screenx #clileft + #clixres / 2 + %1 + %2 + %4
      set %screeny #clitop + #cliyres / 2 + %1 - %2 - %3 + %5
      set %offscreen #true
      if %screenx > #clileft &&
          + %screeny > #clitop &&
          + %screenx < ( #clileft + #clixres ) &&
          + %screeny < ( #clitop + #cliyres )
      {
          set %offscreen #false
          wait 2
          set %screeny %screeny - 50
         click %screenx %screeny d
      }
  return
  sub ToogleQuest //for click on bolts
    set %1 ( %1 - #charposx ) * 22 ; world x-coordinate
    set %2 ( #charposy - %2 ) * 22 ; world y-coordinate
    set %3 ( %3 - #charposz ) * 4  ; world z-coordinate
    if %0 < 4 || %4 = N/A
        set %4 0                   ; x displacement, added to screen coordinate
    if %0 < 5 || %5 = N/A
        set %5 35                  ; y displacement, added to screen coordinate
    set %screenx #clileft + #clixres / 2 + %1 + %2 + %4
    set %screeny #clitop + #cliyres / 2 + %1 - %2 - %3 + %5
    set %offscreen #true
    if %screenx > #clileft &&
        + %screeny > #clitop &&
        + %screenx < ( #clileft + #clixres ) &&
        + %screeny < ( #clitop + #cliyres )
    {
        set %offscreen #false
        wait 2
       set %screeny %screeny - 50
       click %screenx %screeny f
       wait 25
       set %screenx %screenx + 66
       set %screeny %screeny + 110
       wait 25
       click %screenx %screeny
       wait 10
       finditem LNK C
       wait 5
       if #findx > 0
       wait 5
       set %boltx #findx + 23
       set %bolty #findy + 9
       wait 5
       click %boltx %bolty x 3 f
       wait 11
       key esc
       ;display Toogle Complete
    }
return
sub CheckSub //quest check
set %checksum 0
contpos 0 0
wait 10
savePix 252 240 0
wait 10
if #pixcol = 8710077
{
;display ok1
wait 10
set %checksum %checksum + 1
return
}
else
{
;display Exiting
return
}
wait 10
SavePix 289 223 0
wait 10
if #pixcol = 8710077
{
;display Ok2
set %checksum %checksum + 1
return
wait 10
}
else
{
;display Exiting2
return
}
wait 10
savepix 253 240 0
if #pixcol = 8710077
{
;display ok3
set %checksum %checksum + 1
wait 10
return
}
else
{
;display exiting3
return
}
wait 10
savepix 253 241 0
if #pixcol = 8710077
{
;display ok4
set %checksum %checksum + 1
wait 10
return
}
else
{
;display exiting4
return
}
wait 10
savepix 246 240 0
if #pixcol = 8710077
{
;display ok5
set %checksum %checksum + 1
wait 10
return
}
else
{
;display exiting5
return
}
if %checksum >= 5
{
click 130 398
wait 10
gosub ToogleQuestItem
return
}
else
{
click 346 400 x 2 f
wait 11
click 346 400 x 2 f
wait 10
goto mainloop
}
return
Sub ToogleQuestItem //toogle quest item
key esc
gosub ToogleQuest #charposx #charposy #charposz 0 %screenydisp
wait 15
if You've_completed_a_quest in #sysMsg || You've_completed_quest in #journal
{
set %cont 1
wait 3
gosub CheckQuest
return
}
else
{
if #contname = status_gump || #contname = stack_gump
{
click #contposx #contposy r
}
gosub ToogleQuestItem
return
}
return
Post Merge: November 28, 2011, 04:36:57 AM
Anybody?
How to get click work, without drag on npc or on me status bar and stock gump on items?