📄 modaccount.bas
字号:
Attribute VB_Name = "ModAccount"
Option Explicit
Private Type location_detail
Name As String
IP As String
Port As String
Serv As Integer
End Type
Public Type Channels
ID As Byte
Val As Byte
Name As String
Connection As String
End Type
Public Type Channel_Info
ID As Integer
Channel_Name As String
ChannelX() As Channels
End Type
Public Type Character
ID As Integer
Name As String
Level As Integer
Class As Integer
Clan As String
Kill As Integer
HP As Integer
MaxHP As Integer
MP As Integer
MaxMP As Integer
Exp As Integer
MaxExp As Integer
Hate As Integer
MaxHate As Integer
Int As Integer
Con As Integer
Sta As Integer
Flee As Integer
Stat5 As Integer
Stat6 As Integer
str As Integer
Dex As Integer
Def As Integer
Agi As Integer
Money As Long
End Type
Public Location() As location_detail
Public tmpServ As Integer, tmpSub As Integer
Public LoginChar() As Character
Public Sub Load_Account()
ReDim Location(0)
Dim All As String, AC() As String, i As Integer, X As Integer
User = rini("Account", "user", "", "account")
Pass = rini("Account", "pass", "", "account")
Loc = rini("Account", "location", "", "account")
Server = rini("Account", "server", 0, "account")
World = rini("Account", "world", 0, "account")
Char = rini("Account", "char", 0, "account")
frmMain.txtUser.Text = User
frmMain.txtPass.Text = Pass
For i = 1 To 10
frmMain.cbChar.AddItem CStr(i)
If Char = i Then frmMain.cbChar.ListIndex = i - 1
Next
All = rini("All_Serv", "Serv", "", "account")
If All <> "" Then
AC = Split(All, ";")
For i = 0 To UBound(AC)
If Trim(AC(i)) <> "" Then
frmMain.cbLocation.AddItem Trim(AC(i))
ReDim Preserve Location(X)
Location(X).Name = Trim(AC(i))
Location(X).IP = rini(AC(i), "ip", "", "account")
Location(X).Port = rini(AC(i), "port", "", "account")
Location(X).Serv = rini(AC(i), "serv", 0, "account")
If Loc = Location(X).Name Then frmMain.cbLocation.ListIndex = i
X = X + 1
End If
Next
End If
End Sub
Public Sub AddAccount()
User = Trim(frmMain.txtUser.Text)
Pass = Trim(frmMain.txtPass.Text)
Loc = Trim(frmMain.cbLocation.Text)
Server = CInt(IIf(Trim(frmMain.cbServer.Text) <> "", Trim(frmMain.cbServer.Text), 0))
World = CInt(IIf(Trim(frmMain.cbWorld.Text) <> "", Trim(frmMain.cbWorld.Text), 0))
Char = CInt(IIf(Trim(frmMain.cbChar.Text) <> "", Trim(frmMain.cbChar.Text), 0))
End Sub
Public Sub SaveAccount()
wini "Account", "name", Trim(frmMain.txtUser.Text), "account"
wini "Account", "pass", Trim(frmMain.txtPass.Text), "account"
wini "Account", "location", Trim(frmMain.cbLocation.Text), "account"
wini "Account", "server", Trim(frmMain.cbServer.Text), "account"
wini "Account", "world", Trim(frmMain.cbWorld.Text), "account"
wini "Account", "char", Trim(frmMain.cbChar.Text), "account"
End Sub
Public Sub Bot_Connect()
Dim i As Integer
For i = 0 To UBound(Location)
If Location(i).Name = Loc Then
frmBot.Winsock.Close
frmBot.Winsock.Connect Location(i).IP, Location(i).Port
Stat "Connecting to " & Location(i).IP & ":" & Location(i).Port
Exit Sub
End If
Next
End Sub
Public Function Return_Class(ID As Integer) As String
Select Case ID
Case 1: Return_Class = "Swordman"
Case 2: Return_Class = "Rapierman"
Case 3: Return_Class = "Spearman"
Case 4: Return_Class = "Rouge"
Case 5: Return_Class = "Physician"
End Select
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -