Yoko

All sides of Injection
It is currently 2025-12-17 14:11:12

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 2005-08-06 00:02:08 
Offline

Joined: 2005-07-21 17:01:07
Posts: 18
Code:
sub filelog() #нужно чтобы скрипт добавлял в текстовый файл время и скилл каждый раз когда он поднялся на 0.1
  var oldskill=uo.SkillVal('Evaluate Intelligence',1)
  if uo.getglobal('s')=='Evaluating Intelligence skill training started' then #вкл/выкл скрипта одной кнопкой
   uo.setglobal('s','Evaluating Intelligence skill training finished')
   else
   uo.setglobal('s','Evaluating Intelligence skill training started')
  endif
  uo.print(uo.getglobal('s'))
  if uo.getglobal('s')=='Evaluating Intelligence skill training started' then
    while not fatal error
       uo.waittargetobject('0x003c42f8')
       uo.useskill('Evaluating Intelligence')
       wait(4400)
     if (uo.skillval('Evaluate Intelligence',1)>oldskill) then
       uo.exec('exec savetofile')
       oldskill=uo.skillval('Evaluate Intelligence',1)
     endif
    wend
  endif
  if uo.getglobal('s')=='Evaluating Intelligence skill training finished' then
    uo.exec('terminate filelog')
  endif
endsub


Code:
sub savetofile()
#time выдает чумовое время типа 24:72:04
  var h,mi,s
  h=left(str(uo.time()),2)
  mi=mid(str(uo.time()),2,2)
  s=right(str(uo.time()),2)
  uo.print('Time is '+(h)+':'+(mi)+':'+(s))

#date выдает старую дату, вчера позавчера и хз что
  var d,mo,y,i,j
  var data=str(uo.date())
  var temp=''
  if len(data)<6 then
    data=data+'0'
  endif
  for i=0 to len(data)-1 #uo.date() выдает дату набором цифр задом наперед вот я его переворачиваю
   temp=temp+mid(data,len(data)-1-i,1)
  next
  data=temp
  d=mid(data,4,2) #вытаскиваю отдельно день месяц и год
  mo=mid(data,2,2)
  y=left(data,2)
  uo.print('Date is '+(d)+'.'+(mo)+'.'+(y))
 
#count тут все норм =)
  uo.print('Counter '+str(uo.timer()/10,0))
 
#savelog это ваще бред - тут помогите плз, в поиске по форуму ничего грамотного по поводу файлов не нашел =(
  var f=file("c:\InjLog.txt")
  f.open()
    f.writeln(''+(h)+':'+(mi)+':'+(s))
    f.writeln(''+str(uo.skillval('Evaluate Intelligence',1)/10))
  f.close()
end sub


ПОДСКАЖИТЕ УМНЫЕ ЛЮДИ, ХДЕ АШИБКИ?=)


Top
   
 Post subject:
PostPosted: 2005-08-06 00:32:02 
Offline
Expert!
User avatar

Joined: 2004-10-15 22:38:04
Posts: 1396
Location: Moscow City.
Про время юзай АСМ (это первое что увидил)
...дальше несмотрел


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited