-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_gui_simple.py
More file actions
127 lines (101 loc) · 4.23 KB
/
Copy pathtest_gui_simple.py
File metadata and controls
127 lines (101 loc) · 4.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env python3
"""
Simple GUI Screenshot Bypass Test
By Taquito Loco 🎮
Simple test to verify the GUI screenshot bypass functionality.
"""
import sys
import os
import time
import cv2
import numpy as np
from datetime import datetime
# Add src to path
sys.path.append('src')
def test_gui_screenshot():
"""Test the GUI screenshot functionality"""
print("🎮 Testing GUI Screenshot Bypass")
print("=" * 50)
try:
from simple_working_bypass import SimpleWorkingBypass
bypass = SimpleWorkingBypass()
print("✅ SimpleWorkingBypass created")
# Test Tibia window detection
print("\n🔍 Testing Tibia window detection...")
if bypass.find_tibia_window():
print("✅ Tibia window found!")
print(f" Window: {bypass.tibia_window}")
# Test single capture
print("\n📸 Testing single capture...")
start_time = time.time()
image = bypass.capture_simple_working()
end_time = time.time()
if image is not None:
print(f"✅ Single capture successful!")
print(f" Size: {image.shape[1]}x{image.shape[0]}")
print(f" Time: {end_time - start_time:.3f}s")
# Check image quality
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
mean_brightness = np.mean(gray)
print(f" Brightness: {mean_brightness:.1f}")
# Save test image
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"logs/gui_test_{timestamp}.png"
os.makedirs("logs", exist_ok=True)
cv2.imwrite(filename, image)
print(f" 💾 Saved as: {filename}")
# Test multiple captures
print("\n🔄 Testing multiple captures...")
successful_captures = 0
total_time = 0
for i in range(5):
try:
start_time = time.time()
image = bypass.capture_simple_working()
end_time = time.time()
if image is not None:
successful_captures += 1
total_time += (end_time - start_time)
print(f" ✅ Capture {i+1}: Success ({end_time - start_time:.3f}s)")
else:
print(f" ❌ Capture {i+1}: Failed")
time.sleep(0.1)
except Exception as e:
print(f" ❌ Capture {i+1}: Error - {e}")
success_rate = (successful_captures / 5) * 100
avg_time = total_time / successful_captures if successful_captures > 0 else 0
print(f"\n📊 Results: {successful_captures}/5 successful ({success_rate:.1f}%)")
print(f" Average time: {avg_time:.3f}s")
return True
else:
print("❌ Single capture failed")
return False
else:
print("❌ Tibia window not found")
print("💡 Make sure Tibia is running")
return False
except ImportError as e:
print(f"❌ Import error: {e}")
return False
except Exception as e:
print(f"❌ Error: {e}")
return False
def main():
"""Main test function"""
print("🎮 GUI Screenshot Bypass Test")
print("By Taquito Loco 🎮")
print("=" * 50)
success = test_gui_screenshot()
print("\n" + "=" * 50)
print("📋 TEST SUMMARY")
print("=" * 50)
if success:
print("✅ Test passed! GUI screenshot bypass is working.")
else:
print("❌ Test failed. Check if Tibia is running.")
print("\n💡 Next steps:")
print("- Make sure Tibia is running")
print("- Try the GUI test button")
print("- Check logs/ folder for captured images")
if __name__ == "__main__":
main()