var _itemList = typeof(GUITextControl).GetField("_itemList", BindingFlags.NonPublic | BindingFlags.Instance);
ArrayList res = (ArrayList)_itemList.GetValue(chatControl);
var _itemsPerPage = typeof(GUITextControl).GetField("_itemsPerPage", BindingFlags.NonPublic | BindingFlags.Instance);
Int32 _itemsPerPageValue = (Int32)_itemsPerPage.GetValue(chatControl);
int iPages = res.Count / _itemsPerPageValue;
if (res.Count % _itemsPerPageValue != 0)
iPages++;
if (iPages > 1)
{
var _upDownControl = typeof(GUITextControl).GetField("_upDownControl", BindingFlags.NonPublic | BindingFlags.Instance);
GUISpinControl val = (GUISpinControl)_upDownControl.GetValue(chatControl);
int _upDownControlValue = val.Value;
val.Value = iPages - 1;
var onPageDown = typeof(GUITextControl).GetMethod("OnPageDown", BindingFlags.NonPublic | BindingFlags.Instance);
onPageDown.Invoke(chatControl, null);
}