• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

VB to Lua

EvilSkillz

Back
Joined
Jul 12, 2012
Messages
1,814
Solutions
2
Reaction score
376
Location
Egypt - Cairo
is there anyway to convert VB to LUA ?
for example how can i convert this code

Code:
If IsOutputActive(OUTPUT2) Then
DeActivateSignal(OUTPUT2)
Else
ActivateSignal(OUTPUT2)
End If
 

StreamSide

Joseluis Gonzalez
Support Team
Joined
Aug 31, 2007
Messages
3,482
Solutions
45
Reaction score
1,052
Location
Arica - Chile
is there anyway to convert VB to LUA ?
for example how can i convert this code

Code:
If IsOutputActive(OUTPUT2) Then
DeActivateSignal(OUTPUT2)
Else
ActivateSignal(OUTPUT2)
End If
Lua:
if IsOutputActive(OUTPUT2) then
    DeActivateSignal(OUTPUT2)
else
    ActivateSignal(OUTPUT2)
end
??
 

Infernum

Senator
Joined
Feb 14, 2015
Messages
5,621
Solutions
558
Reaction score
3,777
Syntactically, yes. For your code snippet I have no idea what you're doing (or why you even need to "convert"?)
Your question is incredibly vague with zero information regarding what you're really asking.
 
OP
EvilSkillz

EvilSkillz

Back
Joined
Jul 12, 2012
Messages
1,814
Solutions
2
Reaction score
376
Location
Egypt - Cairo
so what about this
Code:
  Switchoffset = GetOEMDRO(1045)
  PipeD = GetOEMDRO(1046)
  BeamW = GetOEMDRO(1047)
  BeamH = GetOEMDRO(1048)

  PipeR = (PipeD/2)
  BeamR = (BeamH/2)
  ClearZ1 = (BeamR + 0.500)
  ClearZ2 = (PipeR + 0.500)
  rapidZdist = 5.592
  rapidZBOX = (rapidZdist - BeamR) - 0.500
  rapidZROUND = (rapidZdist - PipeR) - 0.500
 
  If (BeamH > .5) Then
 
 
        code "G53 G00 Z-.500"
         While Ismoving()
        Wend
    
        
        code "G00 Y0.00"
          While Ismoving()
        Wend
    code "G53 G00 A0.00"
     While Ismoving()
        Wend
    code "G53 G00 Z- " & rapidZBOX
     While Ismoving()
        Wend
        
        SetDro(2,0)
        Code "G31 z-6.00 f30"
        While Ismoving()
        Wend
    zprobepos = GetVar (2002)
    Code "G01 Z" & zprobepos
    While Ismoving()
        Wend
    SetDro(2,0)
    sleep 500
    code "G00 Z" & Switchoffset
    While Ismoving()
        Wend
    
       SetDro(2,BeamR)
       sleep 500
       code "G00 Z " & ClearZ1
              
              
              
Else
 
      code "G53 G00 Z-.500"
         While Ismoving()
        Wend
        
      code "G00 Y0.00"
          While Ismoving()
        Wend
      code "G53 G00 Z- " & rapidZROUND
     While Ismoving()
        Wend
    SetDro(2,0)
        Code "G31 z-6.00 f30"
        While Ismoving()
        Wend
    SetDro(2,0)
    sleep 500
    code "G00 Z" & Switchoffset
    While Ismoving()
        Wend
    
       SetDro(2,PipeR)
       sleep 500
       code "G00 Z " & ClearZ2
      
       End If
 

Infernum

Senator
Joined
Feb 14, 2015
Messages
5,621
Solutions
558
Reaction score
3,777
so what about this
Code:
  Switchoffset = GetOEMDRO(1045)
  PipeD = GetOEMDRO(1046)
  BeamW = GetOEMDRO(1047)
  BeamH = GetOEMDRO(1048)

  PipeR = (PipeD/2)
  BeamR = (BeamH/2)
  ClearZ1 = (BeamR + 0.500)
  ClearZ2 = (PipeR + 0.500)
  rapidZdist = 5.592
  rapidZBOX = (rapidZdist - BeamR) - 0.500
  rapidZROUND = (rapidZdist - PipeR) - 0.500

  If (BeamH > .5) Then


        code "G53 G00 Z-.500"
         While Ismoving()
        Wend
   
       
        code "G00 Y0.00"
          While Ismoving()
        Wend
    code "G53 G00 A0.00"
     While Ismoving()
        Wend
    code "G53 G00 Z- " & rapidZBOX
     While Ismoving()
        Wend
       
        SetDro(2,0)
        Code "G31 z-6.00 f30"
        While Ismoving()
        Wend
    zprobepos = GetVar (2002)
    Code "G01 Z" & zprobepos
    While Ismoving()
        Wend
    SetDro(2,0)
    sleep 500
    code "G00 Z" & Switchoffset
    While Ismoving()
        Wend
   
       SetDro(2,BeamR)
       sleep 500
       code "G00 Z " & ClearZ1
             
             
             
Else

      code "G53 G00 Z-.500"
         While Ismoving()
        Wend
       
      code "G00 Y0.00"
          While Ismoving()
        Wend
      code "G53 G00 Z- " & rapidZROUND
     While Ismoving()
        Wend
    SetDro(2,0)
        Code "G31 z-6.00 f30"
        While Ismoving()
        Wend
    SetDro(2,0)
    sleep 500
    code "G00 Z" & Switchoffset
    While Ismoving()
        Wend
   
       SetDro(2,PipeR)
       sleep 500
       code "G00 Z " & ClearZ2
     
       End If
From Googling it looks like you're using this for something called Mach, which I doubt anyone here will be able to 1:1 convert for you since this is a Tibia forum. Easiest thing to do is just look up both the VB and Lua reference manuals and convert it yourself using basic programming knowledge, this is just syntax conversion & looking for an equivalent Lua function to use from the VB code (if there is an equivalent).
 
Top