Author Topic: Check Script  (Read 2030 times)

0 Members and 1 Guest are viewing this topic.

Offline exmikeTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • exmike has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Check Script
« on: November 27, 2011, 05:23:48 PM »
0
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?

Quote
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? :(
« Last Edit: November 28, 2011, 04:36:57 AM by exmike »

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: Check Script
« Reply #1 on: December 02, 2011, 07:46:12 AM »
0
Off top of my head without testing,  I dont believe  the below works

click 346 400 x 2 f

I believe you must not include the spaces ie

click 346 400 x2f

Possibly you need to do it this way

click 346 400 fx2

You also probably dont need to specify the fast parament when doing the multi click so below should definatly work

click 346 400 x2

As i say off top of head not at a machine i can test anything currently


~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

Related you dont need to move the gumps to 0, 0 prior to clicking a button on a gump and you shouldnt need to click more than once or use fast click to click a button.  Instead you should adjust the click positions relative to the gump postion and wait for the gump to open prior to clicking so you know the gump is thier

eg

Code: [Select]
; wait for gump to open
While #contname <> Blabla
  wait 1

; if gump open click button wait, keep clicking until gump closes.
while #contname = blabla
  {
  set !x 346 + #contposx
  set !y 400 + #contposy
  click !x !y
  wait 5
  }
« Last Edit: December 02, 2011, 07:50:20 AM by Endless Night »
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."

Tags: