Thread: [Guide] AI
View Single Post
Old 21.06.2007, 10:43   #4
HF
Архивный участник
 
Join Date: Aug 2005
Posts: 1,531
Default

Simple using Function.
Func_call, push_const, mul

Code:
       push_event      //  myself
       push_const 704
       add
       fetch_i
       push_const 1005
       push_const 120
       push_const 1000
       mul
       func_call 184680487     //  func[AddTimerEx]
       shift_sp -2
       shift_sp -1
Make all by step-by-step (1,2,3- stack value's in stack)
  1. add myself event to stack (1)
  2. add value 1005 stack (2)
  3. add value 120 to stack (3)
  4. add value 1000 to stack (4)
  5. use 'mul'. Mul - arithmetical command for * two value. Read 2 last stack value and made operation - 120* 1000. Save to stack (120*1000) (3)
  6. start funtion AddTimerEx with use 2 params and 1 output
    Code:
    myself->AddTimerEx(1005, (120 * 1000));
  7. clear this unused stack values from stack -2 (1)
  8. clear this unused stack values from stack -1 (0)
HF is offline